Perhaps this is useful for you:
# A simple function (EDIT: FIXED) Split_and_save_DF <- function(DF, split){
Example
DF <- data.frame(matrix(rnorm(144*12, 100, 30), ncol=144)) dim(DF)
Where DF is data.frame and split is the number of columns by which to divide the dataframe.
This is not a good answer, but it does what you want.
This function will split your DF and save each new DF in the current working directory with names such as: DF1.txt , DF2.txt , DF3.txt .... so you can read each file by doing:
read.table("DF1.txt", header=TRUE)
To check the output:
dim(read.table("DF1.txt", header=TRUE)) # checking dims of new DF's [1] 12 3
source share