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
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
>>
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]]
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
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
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
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
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
*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
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
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
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
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
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
c("purple",
> "blue",
> "green",
> "yellow",
> "orange",
> "red"),
>limits=lim)
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)
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
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
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
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,
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
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
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
> >
> Go...
> > Live: OO#.. Dead: OO#.. Playing
> > Research Engineer (Solar/BatteriesO.O#. #.O#. with
> > /Software/Embedded Controllers) .OO#. .OO#.
> rocks...1k
> >
>
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
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)
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
;)
>
> 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
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
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
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.
>
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,
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")
>
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
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
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.
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
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
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)
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
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
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
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
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
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,
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 (
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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)
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
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.
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
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)
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
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"
>
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"
>
>
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
>
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
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
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
75 matches
Mail list logo