Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution of reading garbled code in RStudio Chinese in R language

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

In this issue, the editor will bring you solutions to read garbled codes in RStudio in R language. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.

When using rjson package to read and process json data in RStudio, the Chinese will be displayed as "" and other similar garbled codes.

The solution can be solved perfectly by entering the following command in the R language terminal.

Sys.setlocale (category= "LC_ALL", locale= "en_US.UTF-8")

Save the following JSON data to a file in json format (note that the file is encoded as UTF-8)

{"ID": ["1", "2", "3", "4", "5", "6", "7", "8"], "Name": ["Rick", "Dan", "Michelle", "Ryan", "Gary", "Nina", "Simon", "Guru"], "Salary": ["623.3", "515.2", "611,729", "843.25" "578", "632.8", "722.5"], "StartDate": ["1xpr 1x2012", "923pr 2013", "11xpr 2014", "5pr 11pr 2014", "3xpx 27px 2015"," 5xpx 21,000pr 2013 "," 7xpxp2013 "," 617plp2014 "]," Dept ": [" IT Department "," Operations "," IT "," HR Human Resources " "Finance", "IT", "Operations", "Finance"]}

Using the rjson package to read json data, the following three lines of command have been issued:

Library ("rjson") result_json

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report