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 method of data reshaping and Export in R language

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article introduces the knowledge of "the method of reshaping and exporting R language data". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Today, I would like to briefly introduce several common R data manipulation techniques-xlsx, export and length-width conversion!

Data Import (xlsx)

I've written a previous article about how R imports different types of data, but it only involves .csv, .txt, and copying directly from the clipboard.

The reason why xlsx was not introduced at that time was that the excel data file was a rich text type and its structure was relatively complex. It needed to remove the support of special packages and the java environment. At that time, the computer did not have a suitable java environment.

Later, it was finished all morning (mainly because the R language system version needs to be strictly consistent with the Java environment version, otherwise the R language cannot automatically detect the Java path, and the Rjava package in the R language cannot be loaded. Importing xlsx data requires the support of the xlsx package, and the xlsx package needs the support of the Rjava package).

So before importing data, it is best to configure your system's java environment to make sure it is consistent with your R language version.

Packages required to import xlsx data:

Library ("rJava")

Library ("xlsx")

Library ("xlsxjars")

The following is the import code:

Data

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