[R] categorical variables

Luis Silva lm.silva at sapo.pt
Mon Apr 14 15:49:10 CEST 2003


Dear helpers

I constructed a data frame with this structure

> str(dados1)
`data.frame':   485 obs. of  16 variables:
 $ Emissor         : int  1 1 1 1 1 1 1 1 1 1 ...
 $ Marisca.Rio     : int  1 1 1 1 1 1 1 1 1 1 ...
 $ Período         : int  1 1 1 1 1 1 1 1 1 1 ...
 $ Reproducao      : int  3 3 3 3 3 3 3 3 3 3 ...
 $ Estacao         : int  2 2 2 2 2 2 2 2 2 2 ...
 $ X30cm           : int  1 1 1 1 1 1 1 1 1 1 ...
 $ Dir.mov         : int  0 0 0 0 0 0 0 0 0 0 ...
 $ Temp.media      : num  12.0 11.3 12.1 12.3 12.4 ...
 $ Temp.amplitude  : num   1.167 -0.750  0.875  0.125 ...
 $ Vel.media       : num  0.479 0.514 0.517 0.445 0.468 ...
 $ Vel.amplitude   : num  -0.04865  0.03417  0.00312 0.02364 ...
 $ Caudal.medio    : num  0.570 0.585 0.589 0.485 0.501 ...
 $ Caudal.amplitude: num  -0.04323  0.01449  0.00405 0.01617 ...
 $ Prof.media      : num  36.1 34.6 34.1 32.9 32.1 ...
 $ Prof.amplitude  : num   0.458 -1.500 -0.500 -1.250 -0.750 ...
 $ Movimento       : num  0 0 0 0 0 0 0 0 0 0 ...

My problem is that the first 7 variables are in fact 
categorical, some of them of the type Present/Absent. R is 
taking them as integer but I want categorical. How can I solve 
this problem? I searched data.frame help but I didn't found any 
parameter to set some variables to categorical


thank you
luis
--


http://adsl.sapo.pt



More information about the R-help mailing list