Re: [R] factor()

From: talepanda <talepanda_at_gmail.com>
Date: Tue 23 Jan 2007 - 06:29:46 GMT

> TeamInfo

    TEAM NAME LEVEL WORKTIME BONUS

1  batch   sunan     B      135 9,818
2  batch  Chenqi     E      121 6,050
3  batch jiangxu     F       97 4,189
4 online  zhouxi     F       63 2,720
5 online  chenhe     H       36 1,064

## try:

> factor(TeamInfo$TEAM)

[1] batch batch batch online online
Levels: batch online

## or

> attach(TeamInfo)
> factor(TEAM)

[1] batch batch batch online online
Levels: batch online

On 1/23/07, qing <qjing@sibs.ac.cn> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Dear All,
>
> I am running Windows XP, R 2.4.1, and doing an example about factor().
>
> > read.csv("c:\\TeamInfo.csv")->TeamInfo;
> > TeamInfo;
> TEAM NAME LEVEL WORKTIME BONUS
> 1 batch sunan B 135 9,818
> 2 batch Chenqi E 121 6,050
> 3 batch jiangxu F 97 4,189
> 4 online zhouxi F 63 2,720
> 5 online chenhe H 36 1,064
> 6 online NA
> 7 online NA
> 8 online NA
> 9 online NA
> 10 client NA
> 11 client NA
> 12 client NA
> 13 client NA
> 14 client NA
> > factor(TEAM)->Teamactor;
> Error in typeof(x) : object "TEAM" not found
>
> Any help or suggestions that you can provide will be greatly appreciated.
>
> Qing
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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@stat.math.ethz.ch 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. Received on Tue Jan 23 17:33:22 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 23 Jan 2007 - 07:30:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.