69918

How to translate international (Lithuanian) characters to the correspondent HTML code in R?

Question:

Is there a way to read text from a text file and convert Latin-4 (ISO/IEC 8859-4) or Latin-6 (ISO/IEC 8859-10) characters to the correspondent HTML code <em>(and vice versa)</em> in R and RStudio, e.g. ą to &261;?

In particular I'm interested in coding-decoding these symbols: <em>Ąą Čč Ęę Ėė Įį Šš Ųų Ūū Žž</em>. I was intending to use regular expressions for this task, but the first problem is that my RStudio does not even read the symbols correctly:

c("Ąą Čč Ęę Ėė Įį Šš Ųų Ūū Žž")

result is:

[1] "Aa Cc Ee Ee Ii Uu Uu ˇ˛"

Answer1:

Well, the best <strong>R</strong> package to read something with non-ASCII locales is <a href="https://github.com/hadley/readr/" rel="nofollow">readr</a> from Hadley Wickham.

You could install it from <a href="https://cran.r-project.org/web/packages/readr/index.html" rel="nofollow">here</a> and check if it supports Latin-6

Recommend

  • C++ infinite loop
  • Trap Ctrl-D in a Ruby Script with ARGF
  • Unique responses rails gem
  • noob queries on unicode and str methods in Python
  • Is JAAS security in Java EE based web application server dependent?
  • “object not found” and “unexpected symbol” errors when timing R code with system.time()
  • How do I keep Google Analytics from corrupting query strings that contain %26?
  • Where can I find a sample for Pcap for Diameter protocol (WireShark)? [closed]
  • Redirect website to mobile site and from mobile to desktop?
  • Getting contents of square brackets, avoiding nested brackets
  • How can I decode an encoded-word String?
  • Issue loading 'dplyr' packages
  • SwipeListView in Xamarin Form
  • Greek letters in a GUI - PYTHON
  • Objective-C : getting error on console while trying to display app on ipad device?
  • How to share a database between ASP.NET MVC 5 application and .NET console application?
  • Installing samr in in R 3.4
  • Hibernate: Inheritance and relationship mapping + generics
  • Sympy: working with equalities manually
  • Basic defensive programming [duplicate]
  • How to check if a string contains any string of a column in MySQL and vice versa?
  • CSS how to fix an element to scroll horizontally with the page but not vertically?
  • TFS - how do I sum child task hours to parent
  • Can my PDF ping my server when it is opened?
  • How to retrieve information from antrun back to maven?
  • How to make R's read_csv2() recognise the text characters properly
  • Cast between interfaces whose interface signatures are same
  • Inline R code in YAML for rmarkdown doesn't run
  • Get history of file changes from TFS to implement custom “blame”-behaviour of exceptions
  • Statically linking a C++ library to a C# process using CLI or any other way
  • Rearranging Cells in UITableView Bug & Saving Changes
  • XCode can't find symbols for a specific iOS library/framework project
  • Circular dependency while pushing http interceptor
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Linker errors when using intrinsic function via function pointer
  • Acquiring multiple attributes from .xml file in c#
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • java string with new operator and a literal