R 3.0|Data Import and Export

Zhenting HE / 2025-02-22


Data Import and Export #

Read CSV File #

data <- read.csv("data.csv", header=TRUE)

Write CSV File #

write.csv(data, "output.csv", row.names=FALSE)

Read Excel File (requires readxl package) #

install.packages("readxl")
library(readxl)
data <- read_excel("data.xlsx", sheet=1)
#R

Last modified on 2025-02-22