[R] problem selecting rows meeting a criterion

2009-08-10 Thread Jim Bouldin
5 5 1 5.00 6 1 2 8.062258 10 5 2 5.656854 11 1 3 2.236068 12 2 3 9.486833 17 2 4 2.236068 18 3 4 8.062258 24 4 5 5.385165 Clearly, this is not what I intend but I cannot figure out what I've done wrong. Any help appreciated. Thanks. Jim Bouldin

Re: [R] problem selecting rows meeting a criterion

2009-08-10 Thread Jim Bouldin
> 3 3 1 2.236068 > 4 4 1 6.324555 > 5 5 1 5.00 > 6 1 2 8.062258 > 10 5 2 5.656854 > 11 1 3 2.236068 > 12 2 3 9.486833 > 17 2 4 2.236068 > 18 3 4 8.062258 > 24 4 5 5.385165 > > > --- On Mon, 8/10/09, Jim Bouldin wrote: > > >

Re: [R] problem selecting rows meeting a criterion

2009-08-11 Thread Jim Bouldin
matrix diagonal) data3 = data2[X>Y,] #remove duplicates from original distance matrix data1;data2;data3 Thoughts much appreciated. Thanks. Jim Bouldin > > Clearly I was more tired than I realised last night. :( My appologies. > > In any case with the data.frame name changed

Re: [R] problem selecting rows meeting a criterion

2009-08-11 Thread Jim Bouldin
command I originally used work. However, I see that it is much easier to just use the subset function or perhaps the with function. Seems that R has many painful lessons to teach. Thanks again. Jim Bouldin > This won't work in general, and is probably only working in this > particular c

[R] NAs and row/column calculations

2010-03-11 Thread Jim Bouldin
What is the trick to calculating summary values from rows or columns containing NAs? Drives me nuts. More nuts that is. Thanks. Jim Bouldin, PhD Research Ecologist Department of Plant Sciences, UC Davis Davis CA, 95616 530-554-1740 __ R-help@r-pr

Re: [R] NAs and row/column calculations

2010-03-11 Thread Jim Bouldin
> > On 12/03/2010, at 11:25 AM, Jim Bouldin wrote: > > > > > I continue to have great frustrations with NA values--in particular > making > > summary calculations on rows or cols of a matrix containing them. For > > example, why does: > > > >&

[R] error message: .Random.seed is not an integer vector but of type 'list'

2009-07-23 Thread Jim Bouldin
1] "numeric" > sample(x, 3) Error in sample(x, 3) : .Random.seed is not an integer vector but of type 'list' > Jim Bouldin, PhD Research Ecologist Department of Plant Sciences, UC Davis Davis CA, 95616 530-554-1740 __ R-help@

Re: [R] error message: .Random.seed is not an integer vector but of type 'list'

2009-07-23 Thread Jim Bouldin
Thank you. However, when I tried that, I got this message: Warning message: In rm(.Random.seed) : variable ".Random.seed" was not found > > Jim Bouldin wrote: > > I'm trying to run this simple random sample procedure and keep getting > the > > error me

Re: [R] error message: .Random.seed is not an integer vector but of type 'list'

2009-07-23 Thread Jim Bouldin
> > > Jim Bouldin wrote: > > Thank you. However, when I tried that, I got this message: > > > > Warning message: > > In rm(.Random.seed) : variable ".Random.seed" was not found > > > In that case, have you attached some package that

Re: [R] error message: .Random.seed is not an integer vector but

2009-07-23 Thread Jim Bouldin
- > E-Mail: (Ted Harding) > Fax-to-email: +44 (0)870 094 0861 > Date: 23-Jul-09 Time: 17:23:09 > ---------- XFMail -- > Jim Bouldin, PhD Research Ecolog

[R] Random # generator accuracy

2009-07-23 Thread Jim Bouldin
, 3, prob = weights;a # (1 million samples from x, of size 3, weighted by "weights"; the mean should be 7.50) [1] 7.406977 > 7.406977/7.5 [1] 0.987597 > b = mean(replicate(100,(sample(x, 3;b # (1 million samples from x, of size 3, not weighted this time; the mean should

Re: [R] Random # generator accuracy

2009-07-23 Thread Jim Bouldin
greg.s...@imail.org > 801.408.8111 > > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > > project.org] On Behalf Of Jim Bouldin > > Sent: Thursday, July 23, 2009 12:00 PM > > To: r-help@r-project.org > > Subject: [R] Rand

Re: [R] Random # generator accuracy

2009-07-23 Thread Jim Bouldin
alue 1.867351 (above) obtained by simulation! > > Ted. > > > E-Mail: (Ted Harding) > Fax-to-email: +44 (0)870 094 0861 > Date: 23-Jul-09 Time: 21:05:07 >

Re: [R] Random # generator accuracy

2009-07-23 Thread Jim Bouldin
manual for the 'sampfling' > package, in particular the function samprop(): > > http://www.stats.bris.ac.uk/R/web/packages/sampfling/sampfling.pdf > > Ted. > > On 23-Jul-09 20:56:43, Jim Bouldin wrote: > > > > You are absolutely correct Ted. When no we

[R] R's database capabilities

2009-08-04 Thread Jim Bouldin
irection to get started? Thanks! Jim Bouldin, PhD Research Ecologist Department of Plant Sciences, UC Davis Davis CA, 95616 530-554-1740 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

[R] subsetting from a vector or matrix

2009-09-24 Thread Jim Bouldin
ubset. Thanks for any help. Jim Bouldin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reprodu

[R] consecutive numbering of elements in a matrix

2009-11-21 Thread Jim Bouldin
columns, the non-NA values within each column (i.e. A[1,1] A[3,2] and A[3,3] would all be set to one, and subsequent values in those columns would increase by one, until the last non-NA value is reached, if any). Any ideas? Thanks Jim Bouldin, PhD Research Ecologist Department of Plant Sciences, UC

Re: [R] consecutive numbering of elements in a matrix

2009-11-21 Thread Jim Bouldin
olumn. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > > > > > Any ideas? > > Thanks > > > > > > Jim Bouldin, PhD > > Research Ecologist > > Department of Plant Sciences, UC Davis > > Davis CA,

Re: [R] consecutive numbering of elements in a matrix

2009-11-22 Thread Jim Bouldin
Many thanks to Dimitris, William and David for very helpful answers which solved my problem. Being a relatve newb, I am confused by something in the solutions by Dimitris and David. #Create a matrix A as follows: > A <- matrix(sample(50, 21), 7, 3) > A[sample(21, 5)] <- NA;A [,1] [,2] [,3

Re: [R] consecutive numbering of elements in a matrix

2009-11-22 Thread Jim Bouldin
> And think about the fact that row(A) and apply(is.na(A), 2, cumsum) > will be identical in the case where there are no NAs, so their > difference would be a zero matrix. Double negativism strikes again > not(is.na) == "is" OK I see it now--thanks. I was interpreting the apply functio

Re: [R] consecutive numbering of elements in a matrix

2009-11-22 Thread Jim Bouldin
), c(1:3, NA,NA, 4,5)) > matrix(B[order(col(B), B)], nrow(B), ncol(B)) > > > I hope it helps. > > Best, > Dimitris Jim Bouldin, PhD Research Ecologist Department of Plant Sciences, UC Davis Davis CA, 95616 530-554-1740 __ R-help

[R] linear regression on groups of consecutive rows of a matrix

2009-11-24 Thread Jim Bouldin
0.40 1.01 0.67 0.17 1.36 1.84 1.06 0.56 NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA etc IF I solve these problems, will I in fact be able to perform individual linear regressions on the (numerous) collections of 5 to 10 rows? Thanks as always for any insight. Jim B

Re: [R] linear regression on groups of consecutive rows of a matrix

2009-11-24 Thread Jim Bouldin
ly there will be 20+ observations per year (row), so for 5 rows I have n = 100+. For my purposes (removing the effect of tree size on ring width for small groups of years) that is more than good enough. Now to try out your suggestion... Jim > > -- > David > > On Nov 24, 2009, at 3:25 P

[R] no html help upon upgrading to 2.10

2009-12-04 Thread Jim Bouldin
For a complete list of functions, use ‘library(help="base")’. and not the html help screen with full package or function description like I used to. Exceedingly problematic, and I can find nothing either in the FAQs or the R search sites on what to do. Solutions much appreciated,

[R] unloading loaded packages

2009-04-30 Thread Jim Bouldin
I can't seem to find info on how to unload packages that have been loaded. My goal in doing so is to gain access to functions that have been masked out by those packages. Or is there another way to do so? Thanks in advance. Jim Bouldin, PhD Research Ecologist Department of Plant Sci

[R] nls error message

2009-12-28 Thread Jim Bouldin
ric', not a 'logical' I've got no clue as to the REAL() to which this is referring. Any help appreciated. Thanks in advance. Jim Bouldin Research Ecologist Department of Plant Sciences, UC Davis Davis CA, 95616 530-554-1740 __ R-

[R] calculations on columns with partially matching names

2010-01-03 Thread Jim Bouldin
" match on the first five characters; their mean would be taken whereas any columns beginning with other than "mpw06" would be excluded. I need to compare every pair of columns in the frame, and in some cases, possibly three at a time. Thanks in advance for any ideas. Jim Bould

[R] assigning a file name, or part of, to an object

2010-01-22 Thread Jim Bouldin
Is there a simple way to do so? Thanks in advance for any help. Jim Bouldin Research Ecologist Department of Plant Sciences, UC Davis Davis CA, 95616 530-554-1740 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

[R] quantiles on rows of a matrix

2010-07-07 Thread Jim Bouldin
also tried: apply(matrix,1,mean,na.rm=T,trim=.05)) and the trim argument was simply ignored Stumped. Any help appreciated. Thanks. Jim Bouldin, PhD Research Ecologist Department of Plant Sciences, UC Davis Davis CA, 95616 530-554-1740 __ R-help@r-project.o

[R] nls error regarding numerics vs logicals

2010-07-09 Thread Jim Bouldin
stant + a.est * 2.7183^(b.est * ba.beg), start = list(constant = 4, : REAL() can only be applied to a 'numeric', not a 'logical'" I can't see where there are any "logicals" in this equation to cause this problem.

Re: [R] nls error regarding numerics vs logicals

2010-07-09 Thread Jim Bouldin
> 1. The expression you gave us is clearly not the one that produced the > error: it involved "ring.area" and "ba.beg". > > 2. You don't tell us what x and y are, so we can't reproduce anything. Sorry, I guess that was unclear. I changed the response and independent variable names to y and

[R] object names from character strings

2010-12-26 Thread Jim Bouldin
to work either. Any help appreciated. Thanks. -- Jim Bouldin, PhD Research Ecologist __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and pr

[R] splitting character strings and converting to numeric vectors

2010-05-06 Thread Jim Bouldin
ot;-448563" "854850" c...448442854842.. "-448442" "854842" c...448301854833.. "-448301" "854833" c...448060854818.. "-448060" "854818" c...446828854736.. "-446828" "854736" So far so good, but

[R] removing duplicate rows

2010-05-11 Thread Jim Bouldin
matter how the arguments were altered: all records were returned instead of the uniques. Completely stumped--any help appreciated. Thanks. Jim Bouldin, PhD Research Ecologist Department of Plant Sciences, UC Davis Davis CA, 95616 530-554-1740 __ R-hel

[R] functions on rows or columns of two (or more) arrays

2011-08-04 Thread Jim Bouldin
ich I assume is not optimal)? Thanks for any help. -- Jim Bouldin, PhD Research Ecologist [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:

[R] changing the x axis labels in a time series plot

2012-07-14 Thread Jim Bouldin
OK, this has to be simple but I've searched through help files, mailing list archives and well, everything I could think of, and still no luck. I simply want to change the x axis labels in a time series graph, from its default numbering (which starts at 1 and increments by 1), to values I have in

[R] converting object elements to variable names and making subsequent assignments thereto

2011-09-23 Thread Jim Bouldin
formulas, such as lm(y~x[,1]) and lm(y~x[,2]), to the variables "model1" and "model2". There are of course, many more than 2 models involved, so brute force is the option of absolute last resort. Thanks for any help. -- Jim Bouldin, Research Ecologis

Re: [R] converting object elements to variable names and making subsequent assignments thereto

2011-09-23 Thread Jim Bouldin
gn() will do what you want; get() runs the other direction. But the > more R way to do it is to put all the models in a list. > > Michael > > On Fri, Sep 23, 2011 at 1:03 PM, Jim Bouldin wrote: > >> This has got to be incredibly simple but I nevertheless can't fi

Re: [R] converting object elements to variable names and making subsequent assignments thereto

2011-09-23 Thread Jim Bouldin
OK, I see. I thought R was just returning the character strings of the model names without doing any assigning, since that's what it displayed. I had it right all along. Thanks for your help. On Fri, Sep 23, 2011 at 1:45 PM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > What exactly

Re: [R] converting object elements to variable names and making subsequent assignments thereto

2011-09-23 Thread Jim Bouldin
to "zzz" at the end which triggers a print statement. > > Michael > > > On Fri, Sep 23, 2011 at 1:56 PM, Jim Bouldin wrote: > >> OK, I see. I thought R was just returning the character strings of the >> model names without doing any assigning, since that&#x

[R] extract the p value

2011-10-24 Thread Jim Bouldin
3] + x[, 6]) [omitted summary output] F-statistic: 40.94 on 2 and 7 DF, p-value: 0.0001371 It does not seem to be obtainable from anova(lm(model)) either, only the p values for the individual predictors. Stumped. Jim Bouldin Research Ecologist [[alternative HTML vers