similar to: a replace for subset

Displaying 20 results from an estimated 9000 matches similar to: "a replace for subset"

2016 Apr 16
0
a replace for subset
Would facet_wrap or facet_grid give you what you want? On Sat, Apr 16, 2016 at 8:45 AM, ch.elahe via R-help <r-help at r-project.org> wrote: > Hi, > I have a data set (mydata), which a part of this is like the following: > > > 'data.frame': 36190 obs. of 16 variables: > $ RE : int 38 41 11 67 30 18 38 41 41 30 ... > $ LU
2016 Apr 16
1
a replace for subset
-Thank you James, well the problem of my type of data is that there can be many possible subsets and therefore plots, and I want to automatically generate them, and facet_wrap does not give me all the possible cases On Saturday, April 16, 2016 6:01 AM, James C. Whanger <james.whanger at gmail.com> wrote: Would facet_wrap or facet_grid give you what you want? On Sat, Apr 16, 2016 at
2004 Dec 30
1
subsetting within a function
hi I am trying to write a function around a glm or similar function, in which I can pass the subsetting constraint as an argument to the function, but I am having trouble. the following commands (if I wanted SEX==0 to be my subset) in the global environment work fine: subexpr <- expression(SEX==0) subtest <- with(mydata, eval(subexpr)) test.glm <- glm(y~x1+x2, data=mydata,
2016 Apr 14
1
a replace for subset
Hi,I have a data set (mydata), which a part of this is like the following:??'data.frame': ? 36190 obs. of 16 variables:$ RE ? ? ? ? ? ? ? ? ? ?: int ?38 41 11 67 30 18 38 41 41 30 ...$ LU ? ? ? ? ? ? ? ? ? ? : int ?4200 3330 530 4500 3000 1790 4700 3400 3640 4000 ...$ COUNTRY ? ? ? ?: Factor w/ 4 levels "DE","FR","JP", "FR"?$Light ? ? ? ? ? ? ? ? ?:
2016 Apr 16
3
a replace for subset
Hi, I have a data set (mydata), which a part of this is like the following: 'data.frame': 36190 obs. of 16 variables: $ RE : int 38 41 11 67 30 18 38 41 41 30 ... $ LU : int 4200 3330 530 4500 3000 1790 4700 3400 3640 4000 ... $ COUNTRY : Factor w/ 4 levels "DE","FR","JP", "FR"? $Light
2016 Apr 23
1
subset by multiple letters condition
Thanks Jean, Does anyone know how to set these [hast1] and [hast2] as the colors of a plot? On Friday, April 22, 2016 7:39 AM, "Adams, Jean" <jvadams at usgs.gov> wrote: You can use the grepl() function to give you logicals for each criterion, then combine them as needed. For example: # example version of Command Command <- paste0("_localize_",
2016 Apr 22
0
subset by multiple letters condition
You can use the grepl() function to give you logicals for each criterion, then combine them as needed. For example: # example version of Command Command <- paste0("_localize_", c("PD","t2","t1_seq", "abc", "xyz", "PD_t1")) hasPD <- grepl("PD", Command, fixed=TRUE) hast1 <- grepl("t1", Command,
2016 Apr 24
0
assign color to subsets
now after this: df_both <- subset(df, grepl("t1", Command) & grepl("t2", Command)) I use factor to apply the subset to df but then the Command level becomes 0 df_both$Command=factor(df_both$Command) str(df_both) $ Protocol : Factor w/ 0 levels: Do you know what is the reason? Thanks for replying On Sunday, April 24, 2016 12:18 PM, jim
2017 Nov 01
1
Correct subsetting in R
It's not what I want, the first data frame has 499 observations and the second data frame is a subset of the first one but with 375 observations. I want something that returns the ID for training data frame On Wednesday, November 1, 2017 10:18 AM, Eric Berger <ericjberger at gmail.com> wrote: matches <- merge(training,data,by=intersect(names(training),names(data))) HTH, Eric
2016 Apr 24
1
assign color to subsets
'grepl' returns a logical vector; you have to use this to get your subset. You can use: df_tq <- subset(df, grepl("t1", Command)) df_t2 <- subset(df, grepl("t2", Command)) # if you want to also get a subset that has both, use df_both <- subset(df, grepl("t1", Command) & grepl("t2", Command)) Jim Holtman Data Munger Guru What is
2017 Nov 01
1
Correct subsetting in R
But they row.names() cannot give me the IDs On Wednesday, November 1, 2017 9:45 AM, David Wolfskill <r at catwhisker.org> wrote: On Wed, Nov 01, 2017 at 04:13:42PM +0000, Elahe chalabi via R-help wrote: > Hi all, > I have two data frames that one of them does not have the column ID: > > > str(data) > 'data.frame': 499 obs. of 608 variables:
2001 Dec 03
1
fitting models with the subset argument
Hi all, I'd like to fit model where the terms both are in the data.frame, mydata say, and are vectors *not in the data.frame*. >obj<-glm(y~x, data=mydata) #works >Z<-pmax(mydata$x-20,0) >(length(Z)==length(obj$y)) >[1] TRUE >update(obj,.~.+Z) #works However for some subset it doesn't works: >obj<-glm(y~x, data=mydata, subset=f==1) #works
2008 May 16
1
xyplot: subscripts, groups and subset
I have stumbled across something in the Lattice package that is vexing me. Consider the code below: __________________________________________________________ library(lattice) myData <- expand.grid(sub = factor(1:16), time = 1:10) myData$observed <- rnorm(nrow(myData)) myData$fitted <- with(myData, ave(observed, sub, FUN = mean)) myData$event.time <- with(myData, ave(observed, sub,
2016 Apr 24
0
assign color to subsets
my problem is that in Command I have 2229 levels and I want to do subsets based on the names I have in Command. for example if the name has t1 or t2 in it or if it has both of them.and then I need to plot in a way that colors are names with t1,names with t2 and names with both. But now even the grepl I use for the subsets does not work correct! :((( hast1=grepl("t1", df$Command,
2017 Nov 29
0
Removing a data subset
Reading in the data from the file x <- read.csv( "ExampleData.csv", header = TRUE, stringsAsFactors = FALSE ) Subsetting as you want x <- x[ x$Location != "MW01", ] This selects all rows where the value in column 'Location' is not equal to "MW01". The comma after that ensures that all columns are copied into the amended data.frame. Rgds,
2007 Aug 26
3
subset using noncontiguous variables by name (not index)
Hi All, I'm using the subset function to select a list of variables, some of which are contiguous in the data frame, and others of which are not. It works fine when I use the form: subset(mydata,select=c(x1,x3:x5,x7) ) In reality, my list is far more complex. So I would like to store it in a variable to substitute in for c(x1,x3:x5,x7) but cannot get it to work. That use of the c function
2006 Mar 24
1
predict.glmmPQL Problem
Dear all, for a cross-validation I have to use predict.glmmPQL() , where the formula of the corresponding glmmPQL call is not given explicitly, but constructed using as.formula. However, this does not work as expected: x1<-rnorm(100); x2<-rbinom(100,3,0.5); y<-rpois(100,2) mydata<-data.frame(x1,x2,y) library(MASS) # works as expected model1<-glmmPQL(y~x1, ~1 | factor(x2),
2017 Jul 26
0
fill out a PDF form in R
Hi Elahe, I have no clue, but maybe you can dump the data fields using pdftk, and work with those in R. HTH Ulrik On Wed, 26 Jul 2017 at 13:50 Elahe chalabi via R-help <r-help at r-project.org> wrote: > Hi all, > > I would like to get ideas about how to fill out a PDF form in R and to > know if it's possible or not. I could not find something helpful in > Internet.
2017 Nov 29
3
Removing a data subset
Say I have a dataset that looks like Location Year GW_Elv MW01 1999 546.63 MW02 1999 474.21 MW03 1999 471.94 MW04 1999 466.80 MW01 2000 545.90 MW02 2000 546.10 The whole dataset is at http://doylesdartden.com/ExampleData.csv and I use the code below to do the graph but I want to do it without MW01. How can I
2012 Feb 09
1
subset select="variable with a list of names"
Hello, I would like to make a function which extracts a subset, from a dataset, with only the columns that I want (specifying their names). For example, having this matrix: > mydata<-matrix(c(22,1,3,2001,24,5,7,2002,26,7,8,2002,28,5,7,2003), byrow=TRUE, ncol=4, dimnames=list(c(1,2,3,4), c("age","day","month","year"))) > mydata age day