[R] adding rows to table
Greetings everyone, I'm trying to add a specific table or a specific number of rows (e.g.44) to a table with no success. This is my basic table > head(dataA) yearplot spp prop.BDCA1DCA2DCA3DCA4 1 20001 a1 0.031079 -0.0776 -0.0009 0.0259 -0.0457 2 20001 a2 0.968921 -0.0448 0.1479 -0.1343 0.1670 3 20002 a1 0.029218 -0.0776 -0.0009 0.0259 -0.0457 4 20002 a4 0.021678 -0.3052 -0.0275 -0.0330 -0.0516 5 20002 a5 0.088596 0.0357 -0.0382 0.0171 -0.0471 6 20002 a6 0.065033 0.1219 -0.0588 -0.1119 -0.1795 I want, every time that the plot number changes, to add a specific table (data2) or a specific number of rows underneath. I've tried several variations of this with no result for (i in 2:nrow(dataA)) { ifelse(dataA$plot[i]!=dataA$plot[i-1],tab=data.frame(res[1:i,1:3]),a=1+1) rbind(as.matrix(dataA[1:i,]),as.matrix(dataB[,])),a=1+1) } many thanks __ 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] adding rows to table
Greetings everyone, I'm trying to add a specific table or a specific number of rows (e.g.44) to a table with no success. This is my basic table > head(dataA) yearplot spp prop.BDCA1DCA2DCA3DCA4 1 20001a1 0.031079 -0.0776 -0.0009 0.0259 -0.0457 2 20001a2 0.968921 -0.0448 0.1479 -0.1343 0.1670 3 20002a1 0.029218 -0.0776 -0.0009 0.0259 -0.0457 4 20002a4 0.021678 -0.3052 -0.0275 -0.0330 -0.0516 5 20002a5 0.088596 0.0357 -0.0382 0.0171 -0.0471 6 20002a6 0.065033 0.1219 -0.0588 -0.1119 -0.1795 I want, every time that the plot number changes, to add a specific table (data2) or a specific number of rows (44) underneath. I've tried several variations of this with no result for (i in 2:nrow(dataA)) { ifelse(dataA$plot[i]!=dataA$plot[i-1],tab=data.frame(res[1:i,1:3]),a=1+1) rbind(as.matrix(dataA[1:i,]),as.matrix(dataB[,])),a=1+1) } many thanks __ 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] PCA and categorical data
Hi all, I' m trying to figure out if it is appropriate to do a PCA having only categorical data (not ordinal). I have only find the following quote: One method to find such relationships is to select appropriate variables and to view the data using a method like Principle Components Analysis (PCA) [4]. This approach gives us a clear picture of the data using KL-plot of the PCA. However, the method is not settled for the data including categorical data. [http://hp.vector.co.jp/authors/VA038807/personal/covEigGiniRep17.pdf] but I'm still not sure if it WRONG to do so. Any opinion or reference would be very helpful thanks __ 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.