subset - R: Undefined Columns Selected Error when Subsetting DF -


i have dataframe data following structure:

classes ‘tbl_df’ , 'data.frame':  4391 obs. of  53 variables 

when try subset top 100 rows using

data100 = data[1:100,] 

i error:

error in `[.data.frame`(x[[i]], ...) : undefined columns selected 

what reason?

found answer - needed use

as.data.frame(data) 

before subsetting because tbl_df not subsettable same way data frame. needed due using dplyr earlier , outputting table instead of df.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -