- R Data Visualization Cookbook
- Atmajitsinh Gohil
- 134字
- 2021-08-06 19:21:07
Exporting data in R
Once we have processed our data, we need to save it to an external device or send it to our colleagues. It is possible to export data in R in many different formats.
How to do it…
To export data from R, we can use the write.table()
function. Please note that R will export the data to our current directory or the folder we have assigned using the setwd()
function:
write.table(data, "mydata.csv", sep=",")
How it works…
The first argument in the write.table()
function is the data in R that we would like to export. The second argument is the name of the file. We can export data in the .xls
or .txt
format, simply by replacing the mydata.csv
file extension with mydata.txt
or mydata.xls
in the write.table()
function.
推薦閱讀
- 從零構建知識圖譜:技術、方法與案例
- Redis Applied Design Patterns
- 少年輕松趣編程:用Scratch創作自己的小游戲
- PHP+MySQL網站開發項目式教程
- Building RESTful Python Web Services
- Learning Apache Cassandra
- Hands-On Neural Network Programming with C#
- Node.js 12實戰
- Angular應用程序開發指南
- Java程序設計與項目案例教程
- Java7程序設計入門經典
- 跟戴銘學iOS編程:理順核心知識點
- Getting Started with hapi.js
- Unity 5 Game Optimization
- 梔子貓的奇幻編程之旅:21天探索信息學奧賽C++編程