similar to: lag and diff with transformBy

Displaying 20 results from an estimated 100 matches similar to: "lag and diff with transformBy"

2010 Mar 17
2
Using nrow with summaryBy
Hello Everyone- I'm calculating summary statistics on a dataset (~4000 records, observations are not uniformly distributed) using summaryBy and trying to add a column with the number of observations to the output as well. What occurs to me is to use nrow(), but this doesn't appear to be working I'm able to replicate the same results with an example from the summaryBy docs:
2013 Jan 03
1
R2OpenBUGS question with differential equations
Dear All,   Currently I am running the following code:   library(stats4) library(odesolve) library(rgenoud) Input<-data.frame(SUB=c(1),time=c(0.5,3,10,15),lev=c(2.05,12.08,9.02,8)) XD<-500 IT<-3 diffeqfun<-function(time, y, parms) {   if(time<=IT)      dCpdt <- (XD/IT)/parms["Vol"] -
2009 Jul 02
7
Params Merge and URL sorting/pagination
Hi all, Here''s my general setup on the specific template I''m having issues with: will_paginate for pagination custom methods for sorting 1-form for team search 1-form for search by date When searching for a team for instance, the url returned will be: /rushing_offenses?search=Florida When searching by date, the url returned will be: /rushing_offenses?compiled_on=2009-07-02
2010 Feb 10
1
using step() with package geepack
I'm using the package geepack to fit GEE models. Does anyone know of methods for add1 and drop1 for a 'geeglm' model object, or perhaps a method for extractAIC based on the QIC of Pan 2001? I see there has been some mention of this on R-help a few years ago (RSiteSearch("QIC")). The package does provide an anova method for its model objects, and update() seems to work:
2004 Oct 08
1
Bug in nlme under version 2.0.0
Dear all, Under version 2.0.0, I get the error below when calling summary() on a lme-object, whereas it works under version 1.9.1 (well, it did last week, before I upgraded). Any help on this? Thx in advance S??ren > library(nlme) > mf <- formula(Weight~Cu*(Time+I(Time^2)+I(Time^3))) > lme1 <- lme(mf, data = dietox, random=~1|Pig) > summary(lme1) Linear mixed-effects model fit
2006 Jan 28
0
using tc on xen
Hi Everyone! My knowledge of tc is very much limited and i got introduced to it by my need for traffic limiting on xen based VM''s. For every VM there is a interface. The network is a bridged network. Has any one tried out something like this ? I tried the below script to limit download on an interface however it didn''t seem to work. Still the interface is able to download at
2009 May 25
3
long format - find age when another variable is first 'high'
Dear R, I've got a data frame with children examined multiple times and at various ages. I'm trying to find the first age at which another variable (LDL-Cholesterol) is >= 130 mg/dL; for some children, this may never happen. I can do this with transformBy and ddply, but with 10,000 different children, these functions take some time on my PCs - is there a faster way to do this in R?
2006 Sep 10
5
why isn't :order working in acts_as_list
Ok, I''m sure this has to be something stupid that I''m doing (or not doing), but I can''t seem to get things to order by the specified column. class List < ActiveRecord::Base has_many :list_items, :order => "orderby" The error I get back when trying to save the link is: Unknown column ''position'' in ''order clause'':
2005 Feb 11
1
Help concerning Lasso::l1ce
Hi, First, when I try the example Prostate with bound 0.44 (as in the manual), I got a different result: > l1c.P <- l1ce(lpsa ~ ., Prostate, bound=0.44) > l1c.P .... Coefficients: (Intercept) lcavol lweight age lbph svi 1.0435803 0.4740831 0.1953156 0.0000000 0.0000000 0.3758199 lcp gleason pgg45 0.0000000 0.0000000
2010 Oct 01
3
scoping goes wrong when some functions are used within others.
Dear, I'm following the r tag on stackoverflow.com, and couldn't but notice there are quite some questions popping up that deal with scoping in relation to custom functions. I grinded my teeth on it already, and I have absolutely no clue what goes wrong. The general pattern is as follows : ff <- function(x){ y <- some_value some_function(y) } > ff(x) Error in eval(expr,
2010 Mar 10
2
ordering columns in a data frame
Dear R users, I have the following data frame: PROCHI date_admission 2 CAO0000713 1999-12-11 4 CAO0000713 1999-10-25 21 CAO0001743 1989-05-04 25 CAO0001743 1996-09-12 26 CAO0001743 1989-05-17 27 CAO0001743 1987-09-17 28 CAO0001743 1987-09-19 29 CAO0001743 1988-01-27 36 CAO0001747 2004-03-21 38 CAO0001747 2004-03-22 39
2009 Jun 09
1
how to use "lapplyBy" function of "doBy" package
Dear Ruser's I want to substitute each "NA" by the group mean of which the "NA" is belonging to. For example, substitute the first record of traits "NA" by the mean of "BSPy01-10" in the dummy dataframe. I have ever tried to solve this problem by using doBy package. But, I failed. I ask for the advice on how to use "lapplyBy" function of
2008 Feb 08
1
reshape question
I know there are a lot of reshape questions on the mailing list, but I haven't been able to find an answer to this particular issue. I am trying to get a datafame structured like this: > sub <- rep(1:5) > ta1 <- rep(1,5) > ta2 <- rep(2,5) > tb1<- rep(3,5) > tb2 <- rep(4,5) > DF <- data.frame(sub,ta1,ta2,tb1,tb2) > DF sub ta1 ta2 tb1 tb2 1
2009 Jun 09
4
how to substitute missing values (NAs) by the group means
Dear Ruser's I ask for helps on how to substitute missing values (NAs) by mean of the group it is belonging to. my dummy dataframe is: > df group traits 1 BSPy01-10 NA 2 BSPy01-10 7.3 3 BSPy01-10 7.3 4 BSPy01-11 5.3 5 BSPy01-11 5.4 6 BSPy01-11 5.6 7 BSPy01-11 NA 8 BSPy01-11 NA 9 BSPy01-11 4.8 10 BSPy01-12 8.1 11 BSPy01-12 6.0 12
2006 Oct 31
2
plotting multiple groups (newbie Q)
Hi Folks, After loading a data set, I run the following: > kSum <- orderBy(~group,(summaryBy(DP_Level~F2 +group,data=kdata,FUN=c(mean,sd),na.rm=T))) kSum looks like this: > kSum F2 group DP_Level.mean DP_Level.sd 1 1.0 N -1.55186475 11.022245 4 2.0 N -2.48013300 10.624583 7 3.0 N -12.47671250 11.104792 10 4.0 N -13.72430950 12.000779 13
2009 Mar 20
4
how to make aggregation in R ?
Hi, I am trying to aggregate the sum of my test data.frame as follow: testDF <- data.frame(v1 = c("a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "c", "c", "c", "c", "c", "d", "d", "d", "d",
2006 Jan 13
2
Saving data in an R package - how to maintain that t avariable is a 'factor' when it is coded as 1, 2, 3...
I have a .txt file obtained by saving a data frame in which the first four columns are factors (but represented as 1,2,3 etc). The first four lines are "Pig" "Evit" "Cu" "Litter" "Start" "Weight" "Feed" "Time" "4601" "1" "1" "1" 26.5 26.5 NA 1 "4601" "1"
2011 Sep 21
0
Resumen de R-help-es, Vol 31, Envío 12 Mann-Whitney U Test
>Hola colegas, no encuentro como hacer el Mann-Whitney U Test en R. > > Alguna solución????? > > Un abrazo a todos. > > Leonardo > Hola Leonardo: La prueba de Mann-Whitney también se conoce como la prueba de suma de rangos de wilcoxon y puede calcularse mediante la función wilcox.test Un saludo, Nicolás Benítez Parejo Técnico de Evaluación e Investigación Agencia
2008 Dec 10
4
tapply within a data.frame: a simpler alternative?
Dear list, I have a data.frame with x, y values and a 3-level factor "group", say. I want to create a new column in this data.frame with the values of y scaled to 1 by group. Perhaps the example below describes it best: > x <- seq(0, 10, len=100) > my.df <- data.frame(x = rep(x, 3), y=c(3*sin(x), 2*cos(x), > cos(2*x)), # note how the y values have a different
2008 Jun 21
1
passing arguments to a function problem
Dear R-users, is there some way how to pass various colnames to the following code for sorting data.frames? mydf.ordered<-with(mydf, mydf[order(colname1,colname2, colnameX, decreasing = TRUE), ]) I was trying something like Afunction<-function (mydf,colnames,decreasing=T){ mydf.ordered<-with(mydf, mydf[order(colnames, decreasing = decreasing), ]) } but it didnt work please