similar to: Divide the data into sub data on a particular condition

Displaying 20 results from an estimated 2000 matches similar to: "Divide the data into sub data on a particular condition"

2013 Aug 25
1
Capturing the whole output using R
Hi, May be this helps: #Creating some dummy data.? set.seed(24) lst1<-lapply(1:8,function(x) ts(sample(1:25,20,replace=TRUE))) set.seed(49) lst2<-lapply(1:8,function(x) ts(sample(1:45,20,replace=TRUE))) ??Find_Max_CCF() #No vignettes or demos or help files found with alias or concept or #title matching ?Find_Max_CCF? using regular expression matching. Found a function with the same
2007 Jul 18
1
Neuman-Keuls
hello, I have programmed this function to calculate the Neuman-Keuls test but I have a problem the function return an empty list and I don't know why. summary(fm1) E <- sqrt((summary(fm1)[[1]]["Residuals","Mean Sq"])/length(LR)) lst <- list() lst1 <- list() lst2 <- list() NK <- function (x) { if (length(x) == 2) { Tstudent <- t.test(subset(exple,
2012 Jan 11
3
turning a list of vectors into a data.frame (as rows of the DF)?
As a newer R practicioner, it seems I stump myself weekly (at least) with issues that have spinning my wheels.  Here is yet another... I'm trying to turn a list of numeric vectors (of uneual length) inot a dataframe.  Each vector held in the list represents a row, and there are some rows of unequal length.  I would like NAs as placeholders for "missing" data in the shorter vectors. 
2004 Jul 06
2
lme: extract variance estimate
For a Monte Carlo study I need to extract from an lme model the estimated standard deviation of a random effect and store it in a vector. If I do a print() or summary() on the model, the number I need is displayed in the Console [it's the 0.1590195 in the output below] >print(fit) >Linear mixed-effects model fit by maximum likelihood > Data: datag2 > Log-likelihood:
2017 Mar 21
3
Problem with sieve_before[solved]
I did chmod -R 777 /var/lib/dovecot and it worked. I just need to figure out what the correct setting are. Thanks everyone //Ger ----------------original message----------------- From:Ger Hooton Scoil Chro? ?osa Blarney [ghooton at scins.ie ] To:Robert Moskowitz [rgm at htt-consult.com ], chaouche yacine [yacinechaouche at yahoo.com ], dovecot at dovecot.org Date:Tue, 21 Mar 2017 14:05:17
2007 Feb 08
5
remove component from list or data frame
Sorry to ask such a simple question, but I can't find the answer after extensive searching the docs and the web. How do you remove a component from a list? For example say you have: lst<-c(5,6,7,8,9) How do you remove, for example, the third component in the list? lst[[3]]]<-NULL generates an error: "Error: more elements supplied than there are to replace" Also,
2008 Oct 01
3
lapply where each list object has multiple parts
Hi. I have a list where each object in the list has multiple parts. I'd like to take the mean of just one part of each object. Is it possible to do this with lapply? If not, can you recommend another function? Thanks. eric > x1 <- c(0,1,2,3) > x2 <- c(7,8) > x3 <- c(2,6,6,8) > x4 <- c(4,8) > > Lst1 <- list(label1 = x1,label2 = x2) > Lst2 <-
2011 Sep 03
3
Saving a list as a Matrix
Hi there. I went through the manual but I couldn't find a solution for my problem. I have list like this one : > lst1 [[1]] [1] 0 1 2 3 [[2]] [1] 0 1 5 [[3]] [1] 2 3 4 and I want to save it as Matrix in Matlab mat format like : 0 1 2 3 0 1 5 0 2 3 4 0 can any body help me ? Appreciate your help and thanks in advance. Reza -- View this message in context:
2013 Sep 05
2
binary symmetric matrix combination
Hi, May be this helps: m1<- as.matrix(read.table(text=" y1 g24 y1 0 1 g24 1 0 ",sep="",header=TRUE)) m2<-as.matrix(read.table(text="y1 c1 c2 l17 ?y1 0 1 1 1 ?c1 1 0 1 1 ?c2 1 1 0 1 ?l17 1 1 1 0",sep="",header=TRUE)) m3<- as.matrix(read.table(text="y1 h4??? s2???? s30 ?y1 0 1 1 1 ?h4 1 0 1 1 ?s2 1 1 0 1 ?s30 1 1 1
2013 Feb 01
29
cumulative sum by group and under some criteria
Thank you very much for your reply. Your code work well with this example. I modified a little to fit my real data, I got an error massage. Error in split.default(x = seq_len(nrow(x)), f = f, drop = drop, ...) : Group length is 0 but data length > 0 On Thu, Jan 31, 2013 at 12:21 PM, arun kirshna [via R] < ml-node+s789695n4657196h87@n4.nabble.com> wrote: > Hi, > Try this: >
2008 Jan 15
1
how to fit model to split data and get residual plots
I have a data set with the following structure (with many more obs.): var1 expt day diameter 1 1 2 0.5 1 1 3 0.9 1 1 4 1.3 1 1 5 1.7 1 2 2 0.3 1 2 3 0.5 1 2 4 0.9 1 2 5 1.6 2 1 2 0.7 2 1 3 1.2 2 1 4 1.6 2 1 5 2.3 2 2 2 0.4 2 2 3 0.8 2 2 4 1.6 2 2 5 3.2 I can get separate regression analysis for each level of var1 and expt with the command: by(data3, data3$var1:data3$expt, function(x)
2013 Jan 11
3
Access comonents in lists of lists
Dear R users,I have a list of equally structured lists, how can I access e.g. all 2nd compontents in those sub-lists?An example:lst <- list(rep(list(1:3),3), rep(list(4:6),3))> lst[[1]][[1]][[1]][1] 1 2 3[[1]][[2]][1] 1 2 3[[1]][[3]][1] 1 2 3[[2]][[2]][[1]][1] 4 5 6[[2]][[2]][1] 4 5 6[[2]][[3]][1] 4 5 6What I want to get are all second sub-lists, in this case:[[1]][[2]][1] 1 2
2013 Apr 13
2
Comparison of Date format
Hi, ?In the example you provided, it looks like the dates in Date2 happens first.? So, I changed it a bit.? DataA<- read.table(text=" ID,Status,Date1,Date2 ??? ??? ?????? 1,A,3-Feb-01,15-May-01 ??? ??? 1,B,15-May-01,16-May-01 ??? ??? 1,A,16-May-01,3-Sep-01 ??? ??? ??? ??? ??? 1,B,3-Sep-01,13-Sep-01 ??? ??? ??? ??? ??? 1,C,13-Sep-01,26-Feb-04 ??? ??? ??? ??? ???
2006 Mar 15
1
manipulating weeks dates
Hi, I have these vectors: > WEEK <- rep(c(1:52),2) > YEAR <- rep(c(2000,1999),c(52,52)) How to make a vector of Date with weeks in years? I try as.date from survival package, but it dont work with weeks, just only with days, months etcs. Thanks Ronaldo -- "Realmente minha cidade e muito facultativa" --Elivelton, ao rep?rter da Jovem Pan que falava das muitas
2016 Apr 29
2
selecting columns from a data frame or data table by type, ie, numeric, integer
Good morning RGuru's I have a data frame of 575 columns.? I want to extract only those columns that are numeric(double) or integer to do some machine learning with.? I have searched the web for a couple of days (off and on) and have not found anything that shows how to do this.?? Lots of ways to extract rows, but not columns.? I have attempted to use "(x == y)" indices extraction
2023 Nov 03
2
Sum data according to date in sequence
Hi, I tried this: # extract date from the time stamp dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh) head(dt1) colnames(dt1) <- c("date", "EnergykWh") and my dt1 becomes these, the dates are replace by numbers. dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh) dput(head(dt1)) colnames(dt1) <-
2005 Nov 16
3
Difficulties with for() {while(){}}
Hi, I have the follow function: function() { ## Init of function ... for(i in test) { ... while(j <= test2) { ... } } } The problem is that sometimes, naturally, the while is not possible to be resolved, and so the program abort. In this case I need that program return to the init of function and run again. How I can make this? Abort the while, abort the for
2005 Sep 09
2
best way to fit a model
Hi, I have some data that have this behaviour: | |******* | * | * | * | * |---------------- What is the best and simpler way to fit this in R? Thanks Ronaldo -- Ela pilotava um Continenal 2001 com igni????o autom??tica Magiclic... -- |> // | \\ [***********************************] | ( ?? ?? ) [Ronaldo Reis J??nior ] |>
2007 Jun 06
1
fixed effects anova in lme lmer
Can lme or lmer fit a plain regular fixed effects anova? Ie a model without a random effect, or have there be at least one random effect in order for these functions to work? Trying to run such, (1) without specifying a random effect produces an error, (2) specifying that there is no random effect does not produce the same output as an anova run in lm(); (2b) specifying that there is no
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
> dt1[ vapply(dt1, FUN=is.numeric, FUN.VALUE=NA) ] a c 1 1 1.1 2 2 1.0 ... 10 10 0.2 Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Apr 29, 2016 at 9:19 AM, Carl Sutton via R-help < r-help at r-project.org> wrote: > Good morning RGuru's > I have a data frame of 575 columns. I want to extract only those columns > that are numeric(double) or integer to do