I have a list of plot ID : c(id_kort) which contains ID of plot like : 'D117_N2C','D117_A2C','D117_C01','D117_C02',.... I obtained it like this :
id_kort = c(df[,"Plot_ID"])
I have a dataframe with data of multiple plots but I only want the ones that are in my list.
I tried this :
vg_data_kort = subset(df2, Plot_ID %in% id_kort)
but got this error :
Warning message in cbind(parts$left, ellip_h, parts$right, deparse.level = 0L):
“number of rows of result is not a multiple of vector length (arg 2)”
Warning message in cbind(parts$left, ellip_h, parts$right, deparse.level = 0L):
“number of rows of result is not a multiple of vector length (arg 2)”
Warning message in cbind(parts$left, ellip_h, parts$right, deparse.level = 0L):
“number of rows of result is not a multiple of vector length (arg 2)”
Warning message in cbind(parts$left, ellip_h, parts$right, deparse.level = 0L):
“number of rows of result is not a multiple of vector length (arg 2)”
If I try to subset a smaller amount, it works perfectly :
vg_data_kort = subset(df2, Plot_ID %in% c('D117_N2C','D117_A2C'))
or
z = c('D117_N2C','D117_A2C')
vg_data_kort = subset(vg_data, Plot_ID %in% z)
I really don't understand why it is doing that...
I also tried :
vg_data_kort=df2[as.character(df$Plot_ID),]
and I got the right dimensions but everything is filled with NA values.
Thank you very much in advance for your help !