search for: alldata

Displaying 20 results from an estimated 69 matches for "alldata".

2010 Jan 09
2
aov function syntax
...esearched other sites, and have included my source files. My goal is to measure the signifigance of the interaction between population and condition (aka. population:condition). I can't seem to figure it out. 1. In the first example the significance of population:condition works with the "allData" but not with the "studentData." Can you please explain why it fails and how I can fix it? 2. In the second example I can get the measure the significance of population:condition with 2 different methods, but I get 2 different results (using the "allData" source). Can you...
2012 May 25
3
Multiple cbind according to filename
...pairs of data frames. The filenames of the frames I need to combine have unique strings. This is my best guess as to the approach to take: filenames<-list.files() filenames [1] "a1.csv" "a2.csv" "b1.csv" "b2.csv" "c1.csv" "c2.csv" alldata<-lapply(filenames, read.csv, header=TRUE) names(alldata)<-filenames summary(alldata) Length Class Mode a1.csv 27 data.frame list a2.csv 27 data.frame list b1.csv 27 data.frame list b2.csv 27 data.frame list c1.csv 27 data.frame list c2.csv 27 data.frame...
2011 Apr 30
3
using tapply with multiple variables
...that I gave to learners of Arabic before and after a phonetic training regime. For each of thirty some subjects there are 800 rows of data, from each of 400 items at pre and posttest. For each item the subject got correct, there is a 'C' in the column 'Correct'. The line: tapply(ALLDATA$Correct, ALLDATA$Subject, function(x)sum(x=="C")) gives me the sum of correct answers for each subject. However, I would like to have that sum separated by Time (pre or post). Is there a simple way to do that? What if I further wish to separate by Group (T or C)? Thanks, Kevin [[a...
2010 Sep 13
2
How to tell R that "ABC" is the name of a dataset not a variable value
...ample, I have a dataset named "ABC" loaded into R > ABC [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 and I also have a variable datasetname > datasetname [1] "ABC" and I want to add this "ABC" dataset to an existing list "alldata" > alldata <-NULL > alldata <- as.list(alldata) since I will have lots of datasets like "ABC" loaded to R, and have datasetname variable record their names, I want to add all the datasets to the list alldata by just writing one command. But I don't know to tell R t...
2008 Jul 09
4
Strptime/ date time classes
Dear all, I've come across a problem using strptime, can anyone explain what's going on? I'm using version 2.7.0 on Windows XP. Thank you Caroline First read in a data file using read.table alldata = read.table(file, header=F, skip=4, colClasses = c("character","numeric")) dim(alldata) [1] 223960 2 # inefficient, safe way of sorting out missing or dodgy data alldata[,2][alldata[,2] < 0] = NA # first ten lines of the data alldata[1:10,] V1 V2...
2009 Apr 10
1
Subset a data frame for plotting
...ture, light, etc.). I would like to break up this large matrix so as to plot data associated with specific ID values (dates) separately. I have learned of several commands that supposedly subset matrices in this manner and have tried the following code with no success: 200706183<-subset(AllData, ID = 200706183) 200706183<-gx.subset(AllData, ID == 200706183) 200706183<-subset(x=AllData, AllData$ID = 200706183) 200706183<-gx.subset(x=AllData, AllData$ID == 200706183) In using this code my plan was to create smaller data frame objects which I could then plot. My first question, t...
2009 Jun 12
2
Automate a data load and merge
...h loaded dataset and are labeled by their name (eg. June01) # Automate this procedure so that I do not have to manuualy type in each column addition when I have a new dataset. # This is my current strategy, but when I have new datasets I have to mannually setup the preallocation and merger allData<-data.frame(Item=item, June01 =NA, June02=NA, June03 =NA) allData[match(June01$Item_Name, allData$Item ),]$June01 <- June01$Occurance allData[match(June02$Item_Name, allData$Item ),]$June02 <- June02$Occurance allData[match(June03$Item_Name, allData$Item ),]$June03 <- June03$Occu...
2012 May 18
3
Sort across multiple csv
...ions and headers, however the data table doesn't begin until the 74th line in each file. Doing some searching, I have been able to create an object with elements consisting of each file in the folder containing the targets (please note this is my working directory): filenames<-list.files() alldata<-lapply(filenames, read.csv, skip=73, header=TRUE) At this point I believe I have created an object with N elements (where N=# files in the wd), each containing the matrix I am attempting to sort. I am completely lost as to how I can sort each matrix based on a single column (say, "Name&q...
2012 Aug 10
1
Direct Method Age-Adjustment to Complex Survey Data
Hi everyone, my apologies in advance if I'm overlooking something simple in this question. I am trying to use R's survey package to make a direct method age-adjustment to some complex survey data. I have played with postStratify, calibrate, rake, and simply multiplying the base weights by the correct proportions - nothing seems to hit the published numbers on the nose. I am trying to
2009 Sep 07
1
Omnibus test for main effects in the face of an interaction containing the main effects.
R 2.9.1 Windows XP I am fitting a random effects ANOVA with two factors Group which has two levels and Time which has three levels: fita<-lme(Post~Time+factor(Group)+factor(Group)*Time, random=~1|SS,data=blah$alldata) I want to get the omnibus significance tests for each factor and the interaction. I believe I can get the omnibus test for the interaction by running the model: fitb<-lme(Post~Time+factor(Group), random=~1|SS,data=blah$alldata) followed by anova(fita,fitb). How do I get the omnibus test for...
2004 Sep 09
2
Handling the windows clipboard/32KB limit
...ome R-code buffering/breaking up the frame to send into small pieces to be collected and assembled in Excel? Chris P.S. (some details for those who are interested) Here is what I use to go from Excel to R (which in turn uses the RExcel add in to send the R call, but not the data): Range("Alldata").Copy Call RRun("Alldata<-read.table(file=file(description='clipboard'),sep='\t',na.strings=c('#N/A',''),header=TRUE,comment.char=';')") There are two funny things about this: 1. It's very fast. 2. (this may be bug or feature depen...
1999 Jan 20
1
Inherit names ...
...he names of the 26 columns get denoted as y.1 to y.6, g.1 to g.6, yc.1 to yc.6, gc.1 to gc.6, yi and gi as these are the internal names. I wish to make a subset of the data using the logical vector R1(length 1024) so that only the cases where R1 is TRUE are included. I can do this by: R1data<-alldata[R1] that gives a vector 7800 long (there are 300 TRUE's in R1) so I do R1data<-as.data.frame(alldata[R1]) which gives a matrix 7800x1 so I write: R1data<-alldata[R1];dim(R1data)<-c(300,26) which gives the data in the right form except I haven't inherited the names at all....
2012 Jun 19
1
Possible bug when using encomptest
...ata<-c(rnorm(10))+seq(0,5,length=10) ##Create a data frame of data to test. The columns ##model1 and model2 contain my basis functions modelFrame<-as.data.frame( list( srcData=fakeData, model1=seq(0,1,length=10), model2=c(rep(0,5),rep(1,5)) ) ) ##Create all data to be fitted allData<-ldply(1:2,function(x){modelFrame$modelFactor<-x;return(modelFrame)}) ##Apply models by factor: models1<-lmList(srcData ~ model1 | modelFactor,data=allData) models2<-lmList(srcData ~ model2 | modelFactor,data=allData) ##Attempt to apply encomptest - it fails! encomptest(models1[[1]],m...
2008 Jun 27
1
xyplot and separate abline per plot
Hello list! I have a set of data like this: > alldata[1:5,] breaks numbers disttype moltype type 1 0.0000000 6598 Gapped Distances 5S Between species 2 0.4066667 0 Gapped Distances 5S Between species 3 0.8133333 5228 Gapped Distances 5S Between species 4 1.2200000 0 Gapped Distances 5S Betw...
2012 Mar 27
1
matrix(unlist(strsplit(""))) 'missing value' issue
...eal or no deal experiment where I have to write some code for. Someone wrote a website to gather the data and write it in a .xlsx file. These are seperate files for seperate participants so first I have to import the seperate datafiles. I do that like this: # Merge the xlsx files into one dataframe alldata <- rbind(read.xlsx('experimentdata.xlsx',1), read.xlsx('experimentdata_1.xlsx',1), read.xlsx('experimentdata_2.xlsx',1) #etc..#read.xlsx('filepath',1) ) The website is poorly written and some of...
2010 Oct 21
1
All other variables in upper scope arg for stepAIC
Hi - I am trying to substitute for "the_other_y" in the code below. I want y2 and y3 to be there when i is 1, y1 and y3 to be there when i is 2 and y1 and y2 to be there when i is 3. I'm sure it's to do with what format the data should be in and I've tried alldata[,-i], but it fits all the columns of alldata except i rather than each column one at a time. I've tried changing the data i.e. as.matrix or as.list but that's still not the right format. I'm sure it's a simple trick, but don't know how to search it out. Any help on how to sea...
2012 Mar 03
1
Problem running stepAIC within a function.
...im,fullsim1,fullsim2,reps=75,opt=0,rand=0,weight=0,match=0){ results <- data.frame(RIB=rep(0,reps),ARIB=rep(0,reps),Conf=rep(0,reps),Dks=rep(0,reps),PL=rep(0,reps),REL=rep(0,reps),VARS=rep(0,reps)) #run simulations of missing data and impute on each #do reps for (j in 1:reps){ #bind data alldata <- cbind(fullsim,fullsim1,fullsim2) cols <- paste(names(alldata),c(rep("",16),rep(1,16),rep(2,16)),sep="") names(alldata) <- cols alldata <- alldata[,-c(3,17:21,33:37)] #create missing values missings <- createmiss(alldata) simmiss <- missings$missd...
2005 Jan 13
2
subsetting like in SAS
...cteristics. I want only a (shorter) list of sites and their characteristics. If "origin", "ship_cat", "ship_nb", "trip" and "set" are needed to identify a site, in SAS you'd sort on those variables, then read the data with: data sites; set alldata; by origin ship_cat ship_nb trip set; if first.set; keep list-of-variables-detailing-sites; run; In R I did this with the Lag function of Hmisc, and the original data set also needs to be sorted first: oL <- Lag(origin) scL <- Lag(ship_cat) snL <- Lag(ship_nb) tL <- Lag(trip) sL &...
2010 Dec 10
1
WriteXLS error:Error in get(x, envir = envir) : variable names are limited to 256 bytes
Hello all, I don't understand why this won't work. I have entered: WriteXLS(alldata,'test.xls') and I get this error message: Error in get(x, envir = envir) : variable names are limited to 256 bytes. My variable names are not very long, and are accepted by write.csv. alldata is a list containing 4 dataframes, with each dataframe having the the same variable names, whic...
2002 May 21
2
Unwanted Levels in R
...9 XX 90.0000 .0000 XX D 36 10.0 10.1 4183.0 4270.7 4219.0 Z 13 0 OBSERV E -9.0 -9.0 -9.0000 -9.0000 -9.0000 -9.0000 -9.0000 -9.0000 -9.0000 10.0 10.1 -1.6970 -1.6971 31.4940 25.3287 34.8044 43.8535 -9.0000 Here are the commands I have tried using to read in the data: >alldata <- read.table("/home/mattb/xxx.dat", fill = TRUE, quote = "") >alldata <- as.list(read.table("/home/mattb/xxx.dat", fill = TRUE, quote = "") Thanks for your time, Matt -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-...