I have three tables: upload, pap1, pap2) each table has 50 column and 150 thousands of rows, I want to split the three dataframes into matched multiple dataframes( where each subset has max 1000 rows) using the unique primary key,
for example, subset_upload1 must have the same ID'S in subset_pap1 and subset_pap2 and so on...
employee_id<-c(1,2,3)
employee <- c('John','Peter ','Jolie')
salary <- c(21000, 23400, 26800)
startdate <- as.Date(c('2010-11-1','2008-3-25','2007-3-14'))
upload<- data.frame(employee_id,employee, salary, startdate)
employee_id<-c(1,2,3)
line_1<-c('address1','address2','address3')
line_2<-c('address1','address2','address3')
postcode<-c('postcode1','postcode2','postcode')
pap1<-data.frame(employee_id,line_1,line_2,postcode)
age<-c(57,43,23)
Height<-c(150,170,190)
gender<-c('M','M','F')
enddate<-as.Date(c('2020-11-1','2020-3-25','2020-3-14'))
pap2<-data.frame(employee_id,age,Height,gender,enddate)
the outcome I am hoping to is:
subupload1<-data.frame(employee_id =1,employee = "John",salary=21000,startdate=as.Date('2010-11-1'))
subpap1_1<-data.frame(employee_id=1,line_1='address1',line_2='address1',postcode='postcode1')
subpap2_1<-data.frame(age=57,Height=150,gender='M',enddate=as.Date('202011-1'))
splitfunction. If you can't provide an example, have a look at: rdocumentation.org/packages/base/versions/3.6.2/topics/split