[R] interpolation in at least 3, perhaps 4 dimensions?

2013-05-09 Thread Benjamin Caldwell
Hello R-helpers, I have a data set of points in three dimensions (x, y, z), each with an associated amplitude. These are data collected using a radar, and of tree roots. There are holes in the data, and I'm interested in interpolating the missing values to create a root map. This could simply be

Re: [R] bigmemory and R 3.0

2013-04-30 Thread Benjamin Caldwell
2013 at 10:35 PM, Prof Brian Ripley wrote: > On 29/04/2013 23:46, Benjamin Caldwell wrote: > >> Dear helpers, >> >> Does anyone have information on the status of bigmemory and R3.0? Will it >> just take time for the devs to re-code for the new environment? Or is >>

[R] bigmemory and R 3.0

2013-04-29 Thread Benjamin Caldwell
Dear helpers, Does anyone have information on the status of bigmemory and R3.0? Will it just take time for the devs to re-code for the new environment? Or is there an alternative for this new version? Thanks Ben Caldwell [[alternative HTML version deleted]]

[R] interesting behavior from aaply

2013-04-29 Thread Benjamin Caldwell
Dear helpers, I'm using plyr to process a large matrix for the first time. My code is set up to work with matrixes, since I learned the hard way that dataframes are considerably slower to process. I started using aaply(), but the data was rearranged from a flat matrix to a [, , 4] array for large

Re: [R] getting started in parallel computing on a windows OS

2013-04-29 Thread Benjamin Caldwell
Martin, This worked, thanks again! *Ben Caldwell* Graduate Fellow University of California, Berkeley 130 Mulford Hall #3114 Berkeley, CA 94720 Office 223 Mulford Hall (510)859-3358 On Thu, Apr 25, 2013 at 10:04 PM, Benjamin Caldwell wrote: > Thanks for this martin. I'll start retoo

Re: [R] getting started in parallel computing on a windows OS

2013-04-25 Thread Benjamin Caldwell
Thanks for this martin. I'll start retooling and let you know how it goes. Ben Caldwell Graduate fellow On Apr 24, 2013 4:34 PM, "Martin Morgan" wrote: > On 04/24/2013 02:50 PM, Benjamin Caldwell wrote: > >> Dear R help, >> >> I've what I think

[R] getting started in parallel computing on a windows OS

2013-04-24 Thread Benjamin Caldwell
Dear R help, I've what I think is a fairly simple parallel problem, and am getting bogged down in documentation and packages for much more complex situations. I have a big matrix (30^5,5]. I have a function that will act on each row of that matrix sequentially and output the 'best' result from t

[R] help with execution of 'embarrassingly parallel' problem using foreach, doParallel on a windows system

2013-04-23 Thread Benjamin Caldwell
Dear R helpers, I have what another member on this forum described as an embarrassingly parallel problem. I am trying to fit models on subsets of some data based on unique combinations of two id factors in the dataset. Total number of combinations is 30^5, and this takes a long time. So, I would l

Re: [R] matrix of size 30^5

2013-04-23 Thread Benjamin Caldwell
*Ben Caldwell* On Sun, Apr 21, 2013 at 9:21 AM, Charles Berry wrote: > Benjamin Caldwell berkeley.edu> writes: > > > > > Dear R helpers > > > > Reproducible example: > > > > #warning - this causes a hard freeze on the machines I've tried it on

[R] matrix of size 30^5

2013-04-20 Thread Benjamin Caldwell
Dear R helpers Reproducible example: #warning - this causes a hard freeze on the machines I've tried it on matrix.holder<- matrix(rnorm(150), nrow=30, ncol=5) Out= expand.grid(matrix.holder[,1],matrix.holder[,2],matrix.holder[,3],matrix.holder[,4], matrix.holder[,5]) Problem: I'm running an an

Re: [R] Rgl

2013-04-04 Thread Benjamin Caldwell
Nice, that worked really well. Thanks Duncan *Ben Caldwell* On Sat, Mar 30, 2013 at 1:31 PM, Duncan Murdoch wrote: > On 13-03-30 3:27 PM, Benjamin Caldwell wrote: > >> Dear r users, >> I have two kinds of data I'm trying to represent in Rgl. >> >> The first

[R] Rgl

2013-03-30 Thread Benjamin Caldwell
Dear r users, I have two kinds of data I'm trying to represent in Rgl. The first are measurements of soils: heights, diameters, and centerpoints of each. I would typically represent these in 3d space as cylinders or cones. The second are radar data of the area under the solids , xyz plus amplitude

Re: [R] Function completely locks up my computer if the input is too big

2013-03-05 Thread Benjamin Caldwell
0.20 > all.equal(BEN, BEN1) > [1] TRUE > > HTH ... > > Peter Alspach > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Benjamin Caldwell > Sent: Wednesday, 6 March 2013 10:18 a.m. > To: r-h

[R] Function completely locks up my computer if the input is too big

2013-03-05 Thread Benjamin Caldwell
Dear r-help, Somewhere in my innocuous function to rotate an object in Cartesian space I've created a monster that completely locks up my computer (requires a hard reset every time). I don't know if this is useful description to anyone - the mouse still responds, but not the keyboard and not wind

Re: [R] ggplot2, geomtile fill assignment

2013-02-21 Thread Benjamin Caldwell
c("purple", > "blue", > "green", > "yellow", > "orange", > "red"), >limits=lim)

Re: [R] ggplot2, geomtile fill assignment

2013-02-21 Thread Benjamin Caldwell
quot;x", zlim= c(0, 12000),main=one[1,4]) filled.contour(zz3,col = topo.colors(24),xlab="x",ylab="x", zlim= c(0, 12000),main=one[1,4]) On Thu, Feb 21, 2013 at 12:02 PM, Benjamin Caldwell wrote: > Dear R help, > > I have some readings in three dimensions (x, y, z)

Re: [R] improving/speeding up a very large, slow simulation

2013-02-13 Thread Benjamin Caldwell
t 3:33 PM, Benjamin Caldwell wrote: > > > Joshua, > > > > Thanks for the example, and the explanation. Nice article that you wrote > - > > the figures alone deserve a deeper dive, I think. > > > > As side note, I found out about profiling on another post and

Re: [R] improving/speeding up a very large, slow simulation

2013-02-13 Thread Benjamin Caldwell
du/stat/r/dae/melogit.htm > > Cheers, > > Josh > > On Tue, Feb 12, 2013 at 12:57 PM, Benjamin Caldwell > wrote: > > Joshua, > > > > So, to your first suggestion - try to figure out whether some operation > > performed on every element of the vector at on

Re: [R] improving/speeding up a very large, slow simulation

2013-02-12 Thread Benjamin Caldwell
here are other experts who can > give a better way to do it. > > Regards, > Anindya > > On Tue, Feb 12, 2013 at 10:52 AM, Benjamin Caldwell < > btcaldw...@berkeley.edu> wrote: > >> Dear R help; >> >> I'll preface this by saying that the example I&#x

[R] improving/speeding up a very large, slow simulation

2013-02-11 Thread Benjamin Caldwell
Dear R help; I'll preface this by saying that the example I've provided below is pretty long, turgid, and otherwise a deep dive into a series of functions I wrote for a simulation study. It is, however, reproducible and self-contained. I'm trying to do my first simulation study that's quite big,

Re: [R] writing to .xlsx

2013-01-09 Thread Benjamin Caldwell
en Caldwell* PhD Candidate University of California, Berkeley 130 Mulford Hall #3114 Berkeley, CA 94720 Office 223 Mulford Hall (510)859-3358 On Wed, Jan 9, 2013 at 2:03 PM, Marc Schwartz wrote: > > On Jan 9, 2013, at 2:45 PM, Gabor Grothendieck > wrote: > > > On Wed, Jan

[R] writing to .xlsx

2013-01-09 Thread Benjamin Caldwell
Dear r helpers; I'm interested in reading from and writing to large .xlsx files fairly regularly. (Why, the naysayers may ask - and the answer is basically colleagues and clients who prefer that format). I've tried out the XLConnect and xlsx libraries, but the java implementation they use just ta

Re: [R] mergeing a large number of large .csvs

2012-11-05 Thread Benjamin Caldwell
t; C:\Users\Owner>perl copyFiles.pl > > daily.BO.csv > > daily.C.csv > > daily.CL.csv > > daily.CT.csv > > daily.GC.csv > > daily.HO.csv > > daily.KC.csv > > daily.LA.csv > > daily.LN.csv > > daily.LP.csv > > daily.LX.csv > >

Re: [R] mergeing a large number of large .csvs

2012-11-03 Thread Benjamin Caldwell
> Go... > > Live: OO#.. Dead: OO#.. Playing > > Research Engineer (Solar/BatteriesO.O#. #.O#. with > > /Software/Embedded Controllers) .OO#. .OO#. > rocks...1k > > >

Re: [R] mergeing a large number of large .csvs

2012-11-03 Thread Benjamin Caldwell
O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --- > Sent from my phone. Please excuse my brevity. > > Benjamin Caldwell wrote: > > >Dear R help

[R] mergeing a large number of large .csvs

2012-11-02 Thread Benjamin Caldwell
Dear R help; I'm currently trying to combine a large number (about 30 x 30) of large .csvs together (each at least 1 records). They are organized by plots, hence 30 X 30, with each group of csvs in a folder which corresponds to the plot. The unmerged csvs all have the same number of columns (5)

Re: [R] turn list into dataframe

2012-10-09 Thread Benjamin Caldwell
Thanks! *Ben Caldwell* On Tue, Oct 9, 2012 at 10:18 AM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > > > On Tuesday, October 9, 2012, Benjamin Caldwell wrote: > >> Thanks Arun - the different lengths in the list elements was the sticking >> point. Do

Re: [R] turn list into dataframe

2012-10-09 Thread Benjamin Caldwell
;) > > fun1<-function(x){ > na.pad<-function(y,len){ > c(y,rep(NA,len-length(y))) > } > maxlen<-max(sapply(x,length)) > do.call(data.frame,lapply(x,na.pad,len=maxlen)) > } > fun1(list1) > A.K. > > > > > > > > - Original Messa

[R] turn list into dataframe

2012-10-08 Thread Benjamin Caldwell
Dear R users, I'm starting to use 'apply' functions rather than for loops in R, and sometimes the output is a bit different than what I want. In this case, the command was tapply(myvector,myindex,cumsum) And the output was something like this: $`SNRL1 Core 120` [1] 2.8546 4.0778 5.2983 6.3

[R] question on assigning an argument in a function that is create by the function itself

2012-09-20 Thread Benjamin Caldwell
Hi, I need some help with making a function a bit more elegant. How would you all suggest avoiding the problem I've made myself below - I've written a function that creates a temporary matrix by subseting a larger one I assign it. I then call vectors from that matrix, add each item in the vector t

Re: [R] trouble with append() in a for loop

2012-06-01 Thread Benjamin Caldwell
rror.temp and value.temp > > You probably actually need something like > > cross.val.error.temp <- append(cross.val.error.temp,value.temp) > print(cross.val.error.temp) > > But this is far from a small reproducible example, so you could need > something else entirely. >

[R] trouble with append() in a for loop

2012-06-01 Thread Benjamin Caldwell
Hello all, * * I'm having some difficulty, and I think the problem is with how I'm using append() nested inside a for loop. The data are: y,x 237537.61,873 5007.148438,227 17705.77306,400 12396.64369,427 228703.4021,1173 350181.9752,1538 59967.79376,630 140322.7774,710 42650.07251,630 5382.858702,

Re: [R] fitting allometric equation using a for a power model

2012-05-31 Thread Benjamin Caldwell
Yes! Thank you. * * *Ben Caldwell* On Thu, May 31, 2012 at 4:03 PM, peter dalgaard wrote: > > On Jun 1, 2012, at 00:14 , Benjamin Caldwell wrote: > > > temppow<-lm(log(y)~log(x)) > > plot(log(y)~log(x)) > > plot(residuals(temppow), main="pow") >

[R] fitting allometric equation using a for a power model

2012-05-31 Thread Benjamin Caldwell
Hello all, I'm fitting an allometric equation that looks like a really clean fit in the log-log space, but when I back transform the fit of the curve appears to need an adjustment - the fitted curve appears to predict values a good deal higher than those from the data. I included a bias correction

Re: [R] indexing in a function doesn't work?

2012-04-06 Thread Benjamin Caldwell
fine. Long run you may have less headaches and stress > if you take more time at the beginning to write clean code. > > I hope this helps, > > Josh > > On Sun, Apr 1, 2012 at 4:34 PM, Benjamin Caldwell > wrote: > > Josh, > > > > Many thank

Re: [R] indexing in a function doesn't work?

2012-04-02 Thread Benjamin Caldwell
obvious to me why it > > > does not work, but I can see a lot of things that could be simplified. > > > It would really help if you could give us a reproducible example. > > > Find/upload/create (in R) some data, and examples of how you would use > > > the function.

Re: [R] indexing in a function doesn't work?

2012-04-01 Thread Benjamin Caldwell
t still > do not work and maybe it is because of something fundamentally wrong > with what I have done, a simple typo, or something else still wrong in > your code that I did not fix. > > Anyway, if you send some data and an example using your function > (i.e., using the data you

[R] indexing in a function doesn't work?

2012-04-01 Thread Benjamin Caldwell
Hello, I've written a small function that's supposed to save me some time, and it's ending up killing it- the intention is to iteratively subset a dataset fram on framevec, fit a model (either lm or nls depending on type) and return the r2 or AIC from the model, respectively. Although as far as I

Re: [R] avoiding expression evaluation when calling a function

2012-03-30 Thread Benjamin Caldwell
op. Best On Fri, Mar 30, 2012 at 12:42 PM, Joshua Wiley wrote: > Hi Benjamin, > > See inline > > On Fri, Mar 30, 2012 at 12:31 PM, Benjamin Caldwell > wrote: > > Another question on functions - I have something that looks like > > > > plotter<-function(i)

Re: [R] scalar assignment within a vector within function

2012-03-30 Thread Benjamin Caldwell
treat all variables as globals you will run into trouble. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf > > Of Benjamin Cal

[R] avoiding expression evaluation when calling a function

2012-03-30 Thread Benjamin Caldwell
Another question on functions - I have something that looks like plotter<-function(i){ temp.i<-rwb[rwb$vector1 <=(i*.10),] with(temp.i, plot(vector2, vector3, main=(i*.10),)) mod<-lm(vector3~vector3-1,data=temp.i) r2<-summary(mod)$adj.r.squared rsqrd[i]<-r2 legend("bottomright", legend=signif(r2

Re: [R] scalar assignment within a vector within function

2012-03-30 Thread Benjamin Caldwell
Thanks all - ended up going with test<<-test On Thu, Mar 29, 2012 at 4:40 PM, Peter Langfelder < peter.langfel...@gmail.com> wrote: > On Thu, Mar 29, 2012 at 3:49 PM, Benjamin Caldwell > wrote: > > Hello, > > > > I'm trying to create a vector of r^2 val

[R] scalar assignment within a vector within function

2012-03-29 Thread Benjamin Caldwell
Hello, I'm trying to create a vector of r^2 values for using a function which I will run in a "for" loop. Example: per<-rnorm(100,.5,.2)^2 x<-rnorm(100,10,5) y<-rnorm(100,20,5) fr<-data.frame(x,y,per) test<-rep(0,9) plotter<-function(i){ temp.i<-fr[fr$per <=(i*.10),] with(temp.i, plot(x, y, mai

Re: [R] CI with confint

2012-03-28 Thread Benjamin Caldwell
that. Thanks for clearing that up. On Wed, Mar 28, 2012 at 1:48 PM, peter dalgaard wrote: > > On Mar 28, 2012, at 21:33 , Benjamin Caldwell wrote: > > > Hello all, > > > > I'm trying to use confint from the MASS package to compute confidence > > intervals

[R] CI with confint

2012-03-28 Thread Benjamin Caldwell
Hello all, I'm trying to use confint from the MASS package to compute confidence intervals for an nls object. When I plot the results, however, they don't make sense - lines cross over the fitted model or just don't match the data. Code is : Thanks for help dat<-data.frame(a,b) with(dat, plot(a,

Re: [R] gsub syntax help

2012-02-02 Thread Benjamin Caldwell
str1.P3" "SPI1.S1.STR2.P1" > > > If your real data are more complex, we need to know what they > look like. > > Sarah > > On Thu, Feb 2, 2012 at 4:42 PM, Benjamin Caldwell > wrote: > > I have some elements in a vector with extraneous information (

[R] gsub syntax help

2012-02-02 Thread Benjamin Caldwell
I have some elements in a vector with extraneous information (e.g. file name and sample IDs) that I'd like to strip from every element. For example, I would like "SPI1.S1.str1.P3.sample.tif" "SPI1.S1.STR2.P1.sample.tif" to read "SPI1.S1.str1.P3" "SPI1.S1.STR2.P1". Will someone help me with the

Re: [R] iterative using values from a data frame to parameterize a function

2011-07-30 Thread Benjamin Caldwell
test<-by(vol,x, vol.exp) Error in tapply(1L:45L, list(DBH = 80:200), function (x) : arguments must have same length *Ben * On Sat, Jul 30, 2011 at 10:16 AM, Benjamin Caldwell wrote: > Or maybe that function should look more like > > vol.exp<-function(x) { > V<-((coeff

Re: [R] iterative using values from a data frame to parameterize a function

2011-07-30 Thread Benjamin Caldwell
Or maybe that function should look more like vol.exp<-function(x) { V<-((coefficient1*(x)^exponent1)+(coefficient2*(x)^exponent2)+constant) V } ? *Ben * On Sat, Jul 30, 2011 at 10:06 AM, Benjamin Caldwell wrote: > Hello, > > I'm just trying to wrap my head around the

[R] iterative using values from a data frame to parameterize a function

2011-07-30 Thread Benjamin Caldwell
Hello, I'm just trying to wrap my head around the syntax for creating loops, functions in R. I have an array of values from a .csv. Looks something like header<-c(species,coefficient1, exponent1, coefficient2, exponent2, constant) with a species name for the first column, and values for coeffici

[R] 3d plotting with cloud and wireframe

2011-07-21 Thread Benjamin Caldwell
Hi, I'm trying to plot an equation in two variables to get a feel for sensitivity to its parameters. I've run expand.grid to get made-up vectors of the combinations of the two independent variables, and am trying to plot the output of the dependent, M, against both the dependent in a 3d space. t

Re: [R] simulation for equation with two variables

2011-07-21 Thread Benjamin Caldwell
That is, run all possible combinations of the two vectors through the equation. *Ben * On Thu, Jul 21, 2011 at 10:04 AM, Benjamin Caldwell wrote: > Hi, > I'm trying to run a basic simulation and sensitivity test by running an > equation with two variables and then plotting the r

[R] simulation for equation with two variables

2011-07-21 Thread Benjamin Caldwell
Hi, I'm trying to run a basic simulation and sensitivity test by running an equation with two variables and then plotting the results against each of the vectors. R is running the vectors like this : 0 with 0, 1 with 1, etc. I would like it to run them like 0 for 1:100, 1 for 1:100, and then the re

[R] using hglm to fit a gamma GLMM with nested random effects?

2011-05-18 Thread Benjamin Caldwell
family=Gamma(link=log), data=rws30.BL) Error in hglm.default(X = X, y = Y, Z = z, family = family, rand.family = rand.family, : Length of X and Z differ. > * Dennis Murphy Tue, May 17, 2011 at 6:18 PM To: Benjamin Caldwell Hi: Someone else (Wayne Zhang, CNA) asked a similar questio

Re: [R] hierarchical gamma model in lme4

2011-05-17 Thread Benjamin Caldwell
Addendum: I tried a gamma fit in glmmPQL and got the same errors. *Ben Caldwell* PhD Candidate University of California, Berkeley On Tue, May 17, 2011 at 3:51 PM, Benjamin Caldwell wrote: > Hello > After seeing this ( > https://stat.ethz.ch/pipermail/r-sig-mixed-models/2011q1/00

Re: [R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-17 Thread Benjamin Caldwell
ble* (no one but > you > has the ``rwb'' data object) example of the problem that you are having > (as the posting guide requests). > > cheers, > > Rolf Turner > > > > On 16/05/11 17:01, Benjamin Caldwell wrote: > > Hmm; still missing somethi

Re: [R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-15 Thread Benjamin Caldwell
t are you trying to hint at? On Fri, May 13, 2011 at 6:05 PM, Rolf Turner wrote: > On 14/05/11 10:00, Benjamin Caldwell wrote: > >> Hello, >> >> I'm trying to compare the fit of two distributions, normal and gamma, to a >> histogram of my response v

[R] using glmer to fit a mixed-effects model with gamma-distributed response variable

2011-05-13 Thread Benjamin Caldwell
Sub: using glmer to fit a mixed-effects model with gamma-distributed response variable Hello, I'm currently trying to fit a mixed effects model , i.e.: > burnedmodel1.2<-glmer(gpost.f.crwn.length~lg.shigo.av+dbh+leaf.area+ bark.thick.bh+ht.any+ht.alive+(1|site/transect/plot), family=gaussian, na.

[R] graphs of gamma, normal fit to a histogram are about half as large as they should be

2011-05-13 Thread Benjamin Caldwell
Hello, I'm trying to compare the fit of two distributions, normal and gamma, to a histogram of my response variable. rate<-mean(na.omit(rwb$post.f.crwn.length))/var(na.omit(rwb$post.f.crwn.length)) shape<-rate*mean(na.omit(rwb$post.f.crwn.length)) hist((rwb$post.f.crwn.length), main="rwb$post.f.c

Re: [R] using lme4 with three nested random effects

2011-04-29 Thread Benjamin Caldwell
what the experiment died of. > ~ Sir Ronald Aylmer Fisher > > The plural of anecdote is not data. > ~ Roger Brinner > > The combination of some data and an aching desire for an answer does not > ensure that a reasonable answer can be extracted from a given body of data. > ~ Jo

[R] using lme4 with three nested random effects

2011-04-28 Thread Benjamin Caldwell
Hi all, I'm trying to fit models for data with three levels of nested random effects: site/transect/plot. For example, modelincrBS<-glmer(l.ru.ba.incr~shigo.av+pre.f.crwn.length+bark.thick.bh+Date+slope.pos.num+dens.T+dbh+leaf.area+can.pos.num+(1|site/transect/plot), data=rws30.UL, family=gaussian

Re: [R] subset without removing NAs

2011-04-28 Thread Benjamin Caldwell
Thanks, that worked. *Ben Caldwell* On Thu, Apr 28, 2011 at 2:02 PM, David Winsemius wrote: > > On Apr 28, 2011, at 3:53 PM, Benjamin Caldwell wrote: > > Hi folks, >> >> I'm dealing with a dataset with a lot of NAs, and want to use subset on >> the >&g

[R] subset without removing NAs

2011-04-28 Thread Benjamin Caldwell
Hi folks, I'm dealing with a dataset with a lot of NAs, and want to use subset on the data without removing the NAs from the the dataframe; e.g. rws50 <- subset(rw.fire.RW,shigo.av<50) This removes instances with NA for the value in addition to anything <50. Any suggestions much appreciated. *B

[R] evaluate a series of equations for a vector

2011-04-12 Thread Benjamin Caldwell
Hi folks, I have a script that will evaluate a single equation for a vector and write graphs to a folder: - species.name="CussoniaHolstii" dia<-10:100 biomass.equals<-21.4863 + 0.5797 * (dia ^ 2)

Re: [R] print to .jpeg

2011-04-12 Thread Benjamin Caldwell
ewly created >> jpeg. >> >> >> species.name="CussoniaHolstii" >> dia<-10:100 >> biomass = -21.4863 + 0.5797 * (dia ^ 2) >> biomass >> jpeg(paste(species.name, '.jpg', sep = '')) >> >> plot (biomass, ma

[R] print to .jpeg

2011-04-12 Thread Benjamin Caldwell
Evening folks, I'm trying to print a series of graphs to .jpeg using a variable as the title, but run into the difficultly that I can't find a way to append the file extension to the .jpeg (in this case extensionless!) files. Example: species.name="CussoniaHolstii" dia<-10:100 biomass = -21.

Re: [R] merge multiple .csv files

2011-02-09 Thread Benjamin Caldwell
ilto:r-help-boun...@r-project.org] > On Behalf Of Benjamin Caldwell > Sent: Thursday, 10 February 2011 1:22 PM > To: r-help > Subject: [R] merge multiple .csv files > > Am trying to merge about 15 .csv tables - tried a test run but came up with > 0 rows (no data for each variable/co

[R] for loop to merge .csvs

2011-02-09 Thread Benjamin Caldwell
So I needed to merge 17 .csv files, and did so by brute force, but I might need to do so again. Anyone have suggestions for a for loop that might do the below for me (where a:r are separate .csv files) ab<-merge(a,b,all=TRUE) cd<-merge(c,d,all=TRUE) ef<-merge(e,f,all=TRUE) gh<-merge(g,h,all=TRUE)

[R] merge multiple .csv files

2011-02-09 Thread Benjamin Caldwell
Am trying to merge about 15 .csv tables - tried a test run but came up with 0 rows (no data for each variable/column head) > CAHSEE.EA.feb.2009<-read.csv("2009 CAHSEE EA feb 2009.csv", header=TRUE) > CAHSEE.IM.MATH.2009<-read.csv("2009 CAHSEE Impact Math.csv", header=TRUE) > testmerge<-merge(CAHSE

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
All right, thanks. On Fri, Aug 6, 2010 at 1:13 PM, David Winsemius wrote: > > On Aug 6, 2010, at 4:03 PM, Benjamin Caldwell wrote: > > Woops, that should read >> e.g. >> >> qqnorm.lme(modelincrF) >> Error: could not find function "qqnorm.lme" >

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
Oh, and now I see the call is qqnorm, not qqnorm.lme. Guess I needed lunch. Ben Caldwell On Fri, Aug 6, 2010 at 1:03 PM, Benjamin Caldwell wrote: > Woops, that should read > e.g. > >> qqnorm.lme(modelincrF) > Error: could not find function "qqnorm.lme" > >

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
Woops, that should read e.g. >> qqnorm.lme(modelincrF) Error: could not find function "qqnorm.lme" On Fri, Aug 6, 2010 at 12:47 PM, Benjamin Caldwell wrote: > Okay, yeah, so he're the deal - nlme is loaded, did the library(nlme) thing > no problem. When I run >

Re: [R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
quot;qqnorm.gls" On Fri, Aug 6, 2010 at 11:24 AM, David Winsemius wrote: > > On Aug 6, 2010, at 1:47 PM, Benjamin Caldwell wrote: > > Hi all, >> >> I'm modeling using lme in the nlme package. qqnorm makes plots just find, >> but when I try to add a line wit

[R] qqline error: Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?

2010-08-06 Thread Benjamin Caldwell
Hi all, I'm modeling using lme in the nlme package. qqnorm makes plots just find, but when I try to add a line with qqline, I get the following error: "Error in sort.list(x, partial = unique(c(lo, hi))) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?" For example > modeli

Re: [R] Cut a within elements by length, not value, of vectors

2010-07-15 Thread Benjamin Caldwell
Thanks all! That did it. On Thu, Jul 15, 2010 at 11:07 AM, Nikhil Kaza wrote: > Building on Erik's solution and because it would easier to do date > arithmetic.. > > d1 <- as.character(date) > d1 <- ifelse(nchar(d1)<4, paste(0,d1,sep=""),d1) > d2 <- as.Date(date, "%m%d") > > > On Jul 15, 2010, a