In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is a detailed introduction to "how to read and write files in R language". The content is detailed, the steps are clear, and the details are properly handled. I hope this article "how to read and write files in R language" can help you solve your doubts. Let's go deeper and learn new knowledge together with the ideas of Xiaobian.
In R, what if we want to read files from the outside world or write files to a specific path?
To read a file, we can use the read.table function; to write a file, we can use the write.table function.
Read.table(file, header = FALSE, sep = "", quote = "\"", dec = ". ", numerals = c("allow.loss", "warn.loss", "no.loss"), row.names, col.names, as.is = ! stringsAsFactors, na.strings = "NA", colClasses = NA, nrows = -1, skip = 0, check.names = TRUE, fill = ! blank.lines.skip, strip.white = FALSE, blank.lines.skip = TRUE, comment.char = "#", allowEscapes = FALSE, flush = FALSE, stringsAsFactors = default.stringsAsFactors(), fileEncoding = "", encoding = "unknown", text, skipNul = FALSE)
Each parameter has its own meaning, among which the more commonly used are header,sep, etc.
file is the name of the file we read;header, set to T or F, whether to define the first line as header;sep is to set the delimiter in the file. Let's look at an example:
mydata
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.