similar to: Using "apply" instead of "for" loop / multithreading

Displaying 20 results from an estimated 500 matches similar to: "Using "apply" instead of "for" loop / multithreading"

2010 Dec 17
2
newbie question on str output
Hi! Here is some output from an str command: > str(CO2) Classes ‘nfnGroupedData’, ‘nfGroupedData’, ‘groupedData’ and 'data.frame': 84 obs. of 5 variables: $ Plant : Ord.factor w/ 12 levels "Qn1"<"Qn2"<"Qn3"<..: 1 1 1 1 1 1 1 2 2 2 ... $ Type : Factor w/ 2 levels "Quebec","Mississippi": 1 1 1 1 1 1 1 1 1 1 ... $
2012 Feb 29
3
Cannot use negative argument in function
Hi, today i wrote a function in R of the type: index.refraction <- function(Temp,Press, RH, CO2) When i try to plug a negative number in Temp, i got this type of error: " n <- index.refraction(Temp= -40,100,80,CO2) Messages d'avis : 1: In Ops.ordered(left, right) : '-' is not meaningful for ordered factors 2: In Ops.factor(left, right) : - not meaningful for factors 3:
2012 May 07
1
How can I brake a label in two lines when using expression()?
I making an xyplot and the y label is too long and needs to be in two rows, but when I brake it there is a huge gap between the last text string and the expression, and I can't get rid of it. Any ideas? Data: structure(list(Temp = c(8L, 8L, 8L, 8L, 8L, 8L, 12L, 12L, 12L, 12L, 12L, 12L), CO2 = c(380L, 380L, 380L, 750L, 750L, 750L, 380L, 380L, 380L, 750L, 750L, 750L), Treat = structure(c(3L,
2012 Feb 29
1
The joys of Nabble: Re: Cannot use negative argument in function
This is yet another problem with the Nabble interface to the list. On Wed, Feb 29, 2012 at 6:21 PM, Richard M. Heiberger <rmh at temple.edu> wrote: > This line > > ?TT <- *Temp*+273.15 > makes it unexecutable. ?that is not the error you mentioned. On nabble, that variable is in bold. When it's reformatted for the plain-text email list, the formatting is converted to **
2012 Dec 05
1
nlme starting values are not the correct length
Dear R community, I am trying to fit an nlme model where I want to estimate the fixed effects of two treatments on the parameters on the following equation Photo~(a*(1-exp(-c*PARi/a)))-b I was able to fit a simple model without covariates following the method described in Mixed-Effects Methods and Classes for S and S-PLUS, version 3.0, but when I add the covariates, I get the error "
2012 May 03
1
braking a label in two lines when using expression()
I making an xyplot and the y label is too long and needs to be in two rows, but when I brake it there is a huge gap between the last text string and the expression, and I can't get rid of it. Any ideas? Data: structure(list(Temp = c(8L, 8L, 8L, 8L, 8L, 8L, 12L, 12L, 12L, 12L, 12L, 12L), CO2 = c(380L, 380L, 380L, 750L, 750L, 750L, 380L, 380L, 380L, 750L, 750L, 750L), Treat = structure(c(3L,
2013 Apr 26
2
Remove reciprocal data from a grouped animal social contact dataset
Hi r-help forum, I have been collecting contact data (with proximity logger collars) between a few different species of animal. All animals wear the collars, and any contact between the animals should be detected and recorded by both collars. However, this isn't always the case and more contacts may be recorded on one collar of the two. This is fine, it depends on battery life and other
2006 Jul 18
2
Using corStruct in nlme
I am having trouble fitting correlation structures within nlme. I would like to fit corCAR1, corGaus and corExp correlation structures to my data. I either get the error "step halving reduced below minimum in pnls step" or alternatively R crashes. My dataset is similar to the CO2 example in the nlme package. The one major difference is that in my case the 'conc' steps are
2008 Aug 21
1
summary.lme and anova question
Dear all, When analyzing data from a climate change experiment using linear mixed-effects models, I recently came across a situation where: - the summary(model) showed a significant difference between the levels of a two-level factor, - while the anova(model) showed no significance for that factor (see below). My question now is: Is the anova.lme() approach correct for that model? And why does
2008 Dec 23
2
beginner data.frame question
I need some help understanding how on of the example data sets is formatted in the basic R installation. If I load the Mona Loa CO2 data, with the command: > data(co2) I can view the data with: > co2 And the data are in the form of 11 rows labeled as years (1994-2004) and 12 columns labeled (Jan - Dec). This structure appears to be a dataframe, however, if I type the command
2013 Jul 09
3
fitting log function: errors using nls and nlxb
Hi- I am trying to fit a log function to my data, with the ultimate goal of finding the second derivative of the function. However, I am stalled on the first step of fitting a curve. When I use the following code: FG2.model<-(nls((CO2~log(a*Time)+b), start=setNames(coef(lm(CO2 ~ log(Time), data=FG2)), c("a", "b")),data=FG2)) I get the following error: Error in
2002 Jun 06
2
covariance analysis model
Dear list users, I have trouble with covariance analysis. I measured nitrate concentrations in the soil (NO3) and the percentage of legumes (LEG, continuous), affected by 2 different CO2 concentrations (CO2, discrete). I suspect that CO2 has an effect on LEG and NO3, but also that LEG has an effect on NO3, so this is the formula I wrote to test this: NO3 ~ CO2 + LEG + CO2:LEG Will LEG be
2007 Jul 16
5
formula(CO2)
The formula attribute of the builtin CO2 dataset seems a bit strange: > formula(CO2) Plant ~ Type + Treatment + conc + uptake What is one supposed to do with that? Certainly its not suitable for input to lm and none of the examples in ?CO2 use the above.
2005 Jul 12
3
using its to import time series data with uneven dates
Good day: I am trying to use readcsvIts("nwr_data_qc.txt",informat=its.format("%Y%m%d%h%M %Y"),header=TRUE,sep="",skip=0,row.names=NULL,as.is=TRUE,dec=".") to read in a file (nwr_data_qc.txt) that looks like this: Time Y M D H Min CO2 2000.18790 2000. 3. 9. 18. 30. 373.60 2000.20156 2000. 3. 14. 18. 30. 373.34
2009 Mar 22
1
Multiple Comparisons for (multicomp - glht) for glm negative binomial (glm.nb)
Hi I have some experimental data where I have counts of the number of insects collected to different trap types rotated through 5 different location (variable -location), 4 different chemical attractants [A, B, C, D] were applied to the traps (variable - semio) and all were trialled at two different CO2 release rates [1, 2] (variable CO2) I also have a selection of continuous variables
2003 Sep 09
2
Making R packages (Unix)
Hi: I have have taken over from a colleague who prepared an R package and failed to build it on Windows. I am doing this with unix as I am a mac user. Below is the output I get when I use the build command: [gattuso:unix/R/CO2.Rcheck] gattuso% R CMD build CO2 * checking for file 'CO2/DESCRIPTION' ... OK * preparing 'CO2': * checking whether 'INDEX' is up-to-date ...
2004 Jan 22
1
spectrum
Dear R users I have two questions about estimating the spectral power of a time series: 1) I came across a funny thing with the following code: data(co2) par(mfrow=c(2,1)) co2.sp1<-spectrum(co2,detrend=T,demean=T,span=3) co2.sp2<-spectrum(co2[1:468],detrend=T,demean=T,span=3) The first plot displays the frequencies ranging from 0 to 6 whearas the second plot displays the same curve but
2010 Jul 23
2
re-ordering bwplot
Dear list: I'm using bwplot to compare concentrations by location and treatment as in: # using built in data bwplot( conc ~ Type : Treatment, data = CO2 ) I would like the order of the plots to be: 3,4,1,2. I can't seem to figure this out with index.cond or permc.cond. Any help is appreciated! Brad Eck [[alternative HTML version deleted]]
2007 Jun 04
3
test for nested factors
Is there a conventional way to test for nested factors? I.e., if 'a' and 'b' are lists of same-length factors, does each level specified by 'a' correspond to exactly one level specified by 'b'? The function below seems to suffice, but I'd be happy to know of a more succinct solution, if it already exists. Thanks, Tim. --- "%nested.in%" <-
2007 Jun 19
1
help w/ nonlinear regression
Dear All, I'd like to fit a "kind" of logistic model to small data-set using nonlinear least-squares regression. A transcript of R-script are reproduced below. Estimated B and T (the model's coeff, herein B=-8,50 and T=5,46) seem appropriate (at least visually) but are quite diff from those obtained w/ SPSS (Levenberg-Marquardt): B=-19,56 and T=2,37. Am I doing something wrong in