everyone. i hope your happiness. and I need your help for my hapiness
I made similar question less than a day ago. but i stuck in similar error this is the thing i should do data_01 is data frame with 2277 rows, 37 cols. my plan was split data_01 to several data frames (and remove data frames less than 100 rows).
data_01_00<-data_01 #family 2277
data_01_01<-data_01_00 %>% filter(rowSums(data_01_00[,1:39])==1 & data_01_00[,1]==1)
data_01_02<-data_01_00 %>% filter(rowSums(data_01_00[,1:2])==2 & data_01_00[,2]==1)
data_01_03<-data_01_00 %>% filter(rowSums(data_01_00[,1:3])==2 & data_01_00[,3]==1)
data_01_05<-data_01_00 %>% filter(rowSums(data_01_00[,1:5])==2 & data_01_00[,5]==1)
data_01_06<-data_01_00 %>% filter(rowSums(data_01_00[,1:6])==2 & data_01_00[,6]==1)
data_01_08<-data_01_00 %>% filter(rowSums(data_01_00[,1:8])==2 & data_01_00[,8]==1)
based on this pattern i tried this. No for loop because data_01_04 and data_01_07 is removed. so i decieded to use user function.
family<- vector(mode = "list", length = 40)
family[1]<-list(data_01_00)
family[2]<-list(data_01_01)
testfunc<-function(i){
family[i]<-data_01_00 %>% filter(paste0('rowSums(data_01_00[,1:',i,'])==2 & data_01_00[,',i,']==1'))
}
I faild. if there was nothing wrong, i would write codes
testfunc(3)
...
testfunc(8)
(actually, code should be devided into 39).
what should i do..?