[R] Split data frame based on Class

2009-05-18 Thread Chris Arthur
Each row of my data frame is assigned to a class (eg country). Can you suggest how I break apart the data frame so that I create new data frames for each class eg If Class = "US" put in new dataframe dataUS Thanks in advance for your help Chris __

[R] Save Cluster results to data frame

2009-05-18 Thread Chris Arthur
If I cluster my data into 3 sets, using pam for instance, is there a way to save the resultant cluster results, to the originating data frame. and related to that how do i say change the cluster names to something a bit more meaningful that 1..2...3 So it goes like this. Data ---> Cluster in

[R] Using sample to create Training and Test sets

2009-05-15 Thread Chris Arthur
Forgive the newbie question, I want to select random rows from my data.frame to create a test set (which I can do) but then I want to create a training set using whats left over. Example code: acc <- read.table("accOUT.txt", header=T, sep = ",", row.names=1) #select 400 random rows in data trai

[R] data frame titles

2008-06-04 Thread Chris Arthur
I'm new to R so please forgive the newbie question; but i can't seem to find a definitive answer to this. I am wanting to do a PLS regression on some data. Which takes a formula of the type "responseACC ~ dataACC" where dataACC is multivariate in nature and responseACC is a single value. I h