Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 202041

how do I apply the same function to the first column of all spreadsheets in the list R?

$
0
0
setwd("C:\\Users\\Documents\spreadsheet")
n <- dir(pattern = ".csv")
files<- NULL
for (i in n) {  files[[i]] <- read.csv(i,sep = ";",header = T) }
 #class(files)
[1] "list"

I saved all spreadsheets in a mass to a list, how do I apply the same function to the first column of all spreadsheets in the list?

library(forecast)
> map(files[,1],auto.arima)
Error in files[, 1] : incorrect number of dimensions

> lapply(files[,1],auto.arima)
Error in files[, 1] : incorrect number of dimensions

All spreadsheets default to the same number of columns.


Viewing all articles
Browse latest Browse all 202041

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>