search for: mydata3

Displaying 11 results from an estimated 11 matches for "mydata3".

Did you mean: mydata
2006 Feb 20
3
Boxplot Help for Neophyte
...m getting to grips with R but came across a small problem today that I could not fix by myself. I have 3 text files, each with a single column of data. I read them in using: myData1<-scan("C:/Program Files/R/myData1.txt") myData2<-scan("C:/Program Files/R/myData2.txt") myData3<-scan("C:/Program Files/R/myData3.txt") I wanted to produce a chart with 3 boxplots of the data and used: boxplot(myData1, myData2, myData3) This worked fine so I consulted R [help(bxp)] to add some format and labels e.g. title= , xlab =, ylab= , notch=TRUE etc. I managed to figure...
2011 Feb 24
1
Selecting data based on the range of dates
Hi: I want to give an index with all the dates between Sept. to Nov. as 1, and anything else is 0. It doesn't matter which year it is, as long as it is between Sept. to Nov, then set up to 1, otherwise is 0. My data frame looks like below: ID Date 201 1/1/05 6:07 AM 201 3/27/09 9:45 AM 201 9/29/09 8:44 AM 203 10/16/08 10:01 AM 203 10/28/08 9:45 AM 203 10/31/08 11:12 AM 203 11/7/08 11:32 AM
2010 Aug 19
1
zoo. window
Hi, I have a dataset including monthly date from 1971-01-01 to 2009-01-01. The dates are character variables. I want to select the subsample from my original data, so I use mydata3<-window(mydata,start="1972-02-01",end="2005-02-01"), or mydata3<-window(mydata, start=as.date("1972-02-01"),end=as.date("2005-02-01")) or mydata3<-window(mydata, start=c(1972-02-01),end=c(2005-02-01)) but I constantly receive Error in attr(x, &quot...
2011 Feb 25
1
speed up process
...947428651, 50460.2202192311, 21810.1456510625, 41747.6053810881)), .Names = c("species", "fruit", "Asfc", "Tfv"), row.names = c(NA, 8L), class = "data.frame") mydata2 <- mydata1[!(mydata1$species %in% c("thgel","alsen")),] mydata3 <- mydata1[!(mydata1$species %in% c("thgel","alsen","poabe")),] mydata_list <- list(mydata1=mydata1, mydata2=mydata2, mydata3=mydata3) #function for regression library(WRS) foo_reg <- function(dat, xvar, yvar, mycol, pos, name.dat){ tsts <- tstsreg(dat[[...
2011 Feb 28
0
Fwd: Re: speed up process
....6947428651, 50460.2202192311, 21810.1456510625, 41747.6053810881)), .Names = c("species", "fruit", "Asfc", "Tfv"), row.names = c(NA, 8L), class = "data.frame") mydata2<- mydata1[!(mydata1$species %in% c("thgel","alsen")),] mydata3<- mydata1[!(mydata1$species %in% c("thgel","alsen","poabe")),] mydata_list<- list(mydata1=mydata1, mydata2=mydata2, mydata3=mydata3) library(WRS) foo_reg<- function(dat, xvar, yvar, mycol, pos, name.dat){ tsts<- tstsreg(dat[[xvar]], dat[[yvar]]) tsts_i...
2012 Sep 24
0
stop on rows where !is.na(mydata$ti_all)
..., NA, new_out_c) new_cma_c = ifelse(new_cma_c == 0, NA, new_cma_c) return(c(newname, NA, NA, NA, new_out_c, new_cma_c, new_c_n, NA)) } }) # recombine and sort colnames(newrows2) = colnames(mydata2) newdata2 = rbind(mydata2, newrows2) newdata2 = newdata2[order(newdata2$id), ] mydata3 <- newdata2 newrows2 <- ddply(mydata3, .(id), function(subdata) { subdata_ty = subdata[!is.na(subdata$ty_all), ] if (NROW(subdata) == 1) { r = subdata[1, ] c("v_001_arm_1", NA, NA, NA, NA, NA, lookup$c_name[lookup$t_name == r$t_name], NA)...
2006 Apr 17
0
autoscall the y-axis
...', col.axis='white', col.lab='magenta', col.main='blue', col.sub='cyan') plot(x,myData[x], type='s', ylim=range(myData)) ## par(new=TRUE) ## plot(x,myData2[x], type='s', col='yellow',axes=F) par(new=TRUE) plot(x,myData3[x], type='s', col='cyan',axes=F) axis(4) tmpusr <<- par('usr') tmpplt <<- par('plt') if(!is.na(curx)){ abline(v=curx, col='red', lty=2) points(curx,myData[curx],pch=16,col='red') } } img <- tkrplot(tt,...
2009 Sep 21
3
compute differences
Hi, I have a problem. I have a data frame looking like: ID val A? .3 B? 1.2 C? 3.4 D? 2.2 E? 2.0 I need to CREATE the following TABLE: CASE?? DIFF A-A??? 0 A-B??? -0.9 A-C??? -3.1 A-D??? -1.9 A-E??? -1.7 B-A??? ... B-B??? ... B-C B-D B-E C-A C-B C-C C-D C-E D-A D-B D-C D-D D-E E-A E-B E-C E-D E-E WHERE CASE IS THE COUPLE OF ELEMENTS CONSIDEREDM AND DIFF IS THE computed DIFFERENCE between
2009 Jun 26
3
to raise in a loop more than 1
I would raise x,y and z in a loop but I won't raise of 1. I tried this but it doesn't work mydata=matrix(nrow=1500,ncol=3) i=1 for(x in 0:10){ for(y in 0:20){ for(z in 0:10){ mydata[i,]=c(x,y,z) i=i+1 z=z+2} y=y+4} x=x+2} And I would have something like that x y z 0 0 0 0 0 2 0 0 4 0 0 6 0 0 8 0 0 10 0 4 0 0 4 2 ... Could anybody help me? I
2007 Aug 10
7
Help wit matrices
Hello all, I am working with a 1000x1000 matrix, and I would like to return a 1000x1000 matrix that tells me which value in the matrix is greater than a theshold value (1 or 0 indicator). i have tried mat2<-as.matrix(as.numeric(mat1>0.25)) but that returns a 1:100000 matrix. I have also tried for loops, but they are grossly inefficient. THanks for all your help in advance. Lanre
2007 Mar 02
2
sampling random groups with all observations in the group
Hi I have a panel dataset with large number of groups and differing number of observations for each group. I want to randomly select say, 20% of the groups or 200 groups, but along with all observations from the selcted groups (with the corresponding data). I guess it is possible to generate a random sample from the groups ids and then match that with the entire dataset to have the intended