添加库
library(sp)
数据
创建data.frame
d <- data.frame(x = 1, y = 1:10, fac = fac)
df <- data.frame(id, rh_gedi, rh_als)
增加一列
df2 <- rbind(d, row)
增加一行
temp_metrics <- cbind(wf_shot_metrics, count=2)
Excel相关的库
library(xlsx)
write.xlsx(YourDataFrame, “C:/Temp/YourExcelFile.xlsx”)
writexl
library(writexl)
mtcars$中文 <- sample(c(“速度快”,“无依赖”,“体积小”), 32,replace=T)
单个sheet
write_xlsx(mtcars,“F:/mtcars.xlsx”)
多个sheet
write_xlsx(list(表1=mtcars[1:15,], 表2=mtcars[16:32,]), “F:/mtcars.xlsx”)
openxlsx
openxlsx::write.xlsx(TotalOutPut3_1,“C:\Users\Administrator\Desktop\处理后的数据.xlsx”)