Say I want to write a function to delete a column from a SparkR DataFrame(Version 1.6.0):
dropColumn <- function(df, col) { df[[col]] <- NULL df } df <- dropColumn(df, 'Email') But it would error out:
Error in `[[<-`(`*tmp*`, col, value = NULL) : [[<- defined for objects of type "S4" only for subclasses of environment How can I change my code fix it?
[[<-.