Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread arun
HI, Saw ur post in Nabble. occ.data<-read.table(text=" Año Punto Especie Pres Ruta_com Point Site Rep guild 1  2012    30    TYSA    1  108    30 1086   5 OTHER 2  2012    26    VACH    1  108    26 1086   1 OTHER 3  2012    27    VACH    1  108    27 1086   2 OTHER 4  2012    26    ZE

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread Andrea Goijman
Thanks!! that should work!! On Wed, Jan 16, 2013 at 1:03 PM, arun wrote: > HI, > > Saw ur post in Nabble. > occ.data<-read.table(text=" > Año Punto Especie Pres Ruta_com Point Site Rep guild > 1 201230TYSA1 10830 1086 5 OTHER > 2 201226VACH1 10826 1

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread arun
Hi, May be this helps you. source("Andreadata.txt")  head(occ.data)  melting<- melt(occ.data,id.var=c("Point", "Site", "Rep", "Año"),measure.var="Pres")  y<-cast(melting,Site~Rep~Point~Año)  dim(y) #[1] 10  5 25  6 y[,,25,6] #  Rep #Site   1 2 3 4 5  # 1021 0 0 0 0 0  # 1022 0 0 0 0 0  # 10

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread Andrea Goijman
Sure! Although I'm not sure how to use dput() Here is more detail and some data what I want is that the repetitions in Y (at the end) only have 1 or 0... > library(reshape) > library(car) > > ###Read in the occurence data > occ.data <- read.table("Occ_short.csv", header=TRUE,sep=",",na.string

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread Jose Iparraguirre
Dear Andrea I may have not understood the question properly, but I guess it has to do with replacing values before and after casting. The molten object ('melting') is a data frame, whilst the cast object ('y') is an array. Crucially, the values of the variable "Rep" in the 'melting' data f

Re: [R] Changing frequency values to 1 and 0

2013-01-16 Thread Jessica Streicher
Sorry, but i don't get the problem at all. Could you provide a bit of y by using dput()? Can you provide an example of how you want the data to look like after the transformation? On 16.01.2013, at 16:42, Andrea Goijman wrote: > Dear list, > > I'm working with a large data set, where I groupe