- 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.
推薦閱讀
- 流量的秘密:Google Analytics網站分析與優化技巧(第2版)
- Bootstrap Site Blueprints Volume II
- 程序員面試算法寶典
- 深入淺出Spring Boot 2.x
- Java Web基礎與實例教程
- Unity UI Cookbook
- Programming with CodeIgniterMVC
- MySQL程序員面試筆試寶典
- Red Hat Enterprise Linux Troubleshooting Guide
- Java程序設計與項目案例教程
- Java并發實現原理:JDK源碼剖析
- 讀故事學編程:Python王國歷險記
- Python程序設計現代方法
- 交互設計語言:與萬物對話的藝術(全兩冊)
- Hadoop MapReduce v2 Cookbook(Second Edition)