Re: [R] Removing session variables

2012-03-18 Thread Duncan Murdoch

On 12-03-18 5:31 AM, Ajay Askoolum wrote:

If I create a data.frame using session variables as follows:

classResults<-data.frame(subjEnglish,gradeEnglish,subjFrench,gradeFrench,row.names=studentName)


How can I remove the variables? I tried


rm(names(classResults))

Error in rm(names(classResults)) :
   ... must contain names or character strings


Use rm(list=names(classResults)).

Duncan Murdoch




Also, how can I include the row.names variable. I tried


names(classResults)

[1] "subjEnglish"  "gradeEnglish" "subjFrench"   "gradeFrench"


but this does not include that name.

Thanks.
[[alternative HTML version deleted]]




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Removing session variables

2012-03-18 Thread Jim Holtman
to remove an individual column:

classResults$subjEnglish <- NULL

to remove object:

rm(classResults)

to access student names:

row.names(classResults)

Sent from my iPad

On Mar 18, 2012, at 5:31, Ajay Askoolum  wrote:

> If I create a data.frame using session variables as follows:
> 
> classResults<-data.frame(subjEnglish,gradeEnglish,subjFrench,gradeFrench,row.names=studentName)
> 
> 
> How can I remove the variables? I tried
> 
>> rm(names(classResults))
> Error in rm(names(classResults)) : 
>   ... must contain names or character strings
> 
> 
> Also, how can I include the row.names variable. I tried
> 
>> names(classResults)
> [1] "subjEnglish"  "gradeEnglish" "subjFrench"   "gradeFrench" 
> 
> 
> but this does not include that name.
> 
> Thanks.
>[[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Removing session variables

2012-03-18 Thread Ajay Askoolum
If I create a data.frame using session variables as follows:

classResults<-data.frame(subjEnglish,gradeEnglish,subjFrench,gradeFrench,row.names=studentName)


How can I remove the variables? I tried

> rm(names(classResults))
Error in rm(names(classResults)) : 
  ... must contain names or character strings


Also, how can I include the row.names variable. I tried

> names(classResults)
[1] "subjEnglish"  "gradeEnglish" "subjFrench"   "gradeFrench" 


but this does not include that name.

Thanks.
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.