0

I am trying this :

class_Of_Objects<-cbind(ls(),data.frame(sapply(ls(), function(x){class(get  (x))})))

colnames(class_Of_Objects)<-c("variable","class_type")

But I also want to add extra column in the dataframe (class_Of_Objects) which can give me what's inside each object. I am trying this for that.

for ( obj in ls() ) { print(get(obj)) }

But as it has different number of rows for each object it is not merging with the original dataframe, is there anyway that I can have three colum dataframe like this:

Variable  class_type  content
KGarg
  • 23
  • 7
  • Might be solved with http://stackoverflow.com/questions/1358003/tricks-to-manage-the-available-memory-in-an-r-session – r2evans Jun 10 '16 at 20:17
  • @r2evans I want to print the content of the objects and they are talking about the memory usage and other things. Thanks though! – KGarg Jun 10 '16 at 20:36
  • 1
    Yes, and the function listed there provides known-working methods for iterating over objects, gather information, and put it out in a coherent manner. When you say "content of the objects", there is a clear distinction between trying to add atomic variables and a 17M row data.frame or n-dimensional array. Can you provide something [reproducible](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? – r2evans Jun 10 '16 at 20:40

0 Answers0