Re: [R] Discrete and Continuous variables

2014-05-18 Thread Patrick Burns

Perhaps something involving:

sapply(dataFrame, function(z) length(unique(z)))

Pat

On 17/05/2014 17:31, a...@dpi.inpe.br wrote:

Hello everybody!

I have a data frame with discrete and continuous variables something
like this:

011.462707165309.0171912.57041000.
101.552373295559.0171809.01701000.
011.195954445809.0171750.1000.
220.964678766059.0171707.10681000.
101.469273923250.559.0170750.
201.652678853500.707.1068750.


Discrete variables should be specified as factor as.factor() and
continuos variables as numeric as.numeric().
The problem is:
The users that will enter with the variables. Is it possible identify
which input variable are continuous or discrete?

Thank guys!

__
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.



--
Patrick Burns
pbu...@pburns.seanet.com
twitter: @burnsstat @portfolioprobe
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of:
 'Impatient R'
 'The R Inferno'
 'Tao Te Programming')

__
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] Discrete and Continuous variables

2014-05-17 Thread acos

Hello everybody!

I have a data frame with discrete and continuous variables something  
like this:


0   1   1.46270716  5309.0171   912.57041000.
1   0   1.55237329  5559.0171   809.01701000.
0   1   1.19595444  5809.0171   750.1000.
2   2   0.96467876  6059.0171   707.10681000.
1   0   1.46927392  3250.   559.0170750.
2   0   1.65267885  3500.   707.1068750.


Discrete variables should be specified as factor as.factor() and  
continuos variables as numeric as.numeric().

The problem is:
The users that will enter with the variables. Is it possible identify  
which input variable are continuous or discrete?


Thank guys!

__
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.