The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
R extension failed on column selection


Hi:
My code is
rm_main = function(dat)
{
#dat<-dat[-which(rowMeans(is.na(dat)) > 0.5), ]
dat<-dat[ ,-which(rowMeans(is.na(dat)) > 0.5)]
return(data.frame(dat))
}
When run "dat<-dat[-which(rowMeans(is.na(dat)) > 0.5), ]", rapidminer get the wanted dataframe, however, when run "dat<-dat[ ,-which(rowMeans(is.na(dat)) > 0.5)]" is wrong.
It take "which(rowMeans(is.na(dat)) > 0.5)" result as a list, not filter the dataframe.
Could you kindly suggest some idea?
Tagged:
0
Answers
The error lies in the R code itself. You are subsetting the columns using row data (porcentange of missing values in a row). That is incorrect.