Re: [R] set seed for random draws

2011-11-05 Thread Prof Brian Ripley
On Sun, 6 Nov 2011, R. Michael Weylandt wrote: I think it's easier than you are making it: the random seed is created in a "pretty-random" way when you first use it and then it is updated Ah: It is unless you then save the workspace. If you do, then evey subsequent session starts with the sa

Re: [R] install.packages problem

2011-11-05 Thread Prof Brian Ripley
This is something missing from your (unstated) Linux installation. curl-config is part of the original libcurl sources, but Linux distributors tend to separte it out. *How* they do so is non-standard: Fedora and other RPM-based distributions tend to use libcurl-devel Debian and related tend

Re: [R] Correlation between matrices

2011-11-05 Thread Dennis Murphy
Hi: I don't think you want to keep these objects separate; it's better to combine everything into a data frame. Here's a variation of your example - the x variable ends up being a mouse, but you may have another variable that's more appropriate to plot so take this as a starting point. One plot us

Re: [R] set seed for random draws

2011-11-05 Thread R. Michael Weylandt
I think it's easier than you are making it: the random seed is created in a "pretty-random" way when you first use it and then it is updated with each call to rDIST(). For example, set.seed(1) x1 <- .Random.seed rnorm(1) x2 <- .Random.seed rnorm(1) x3 <- .Random.seed identical(x1, x2) FALSE ide

Re: [R] Matrix element-by-element multiplication

2011-11-05 Thread R. Michael Weylandt
There are a few (nasty?) side-effects to c(), one of which is stripping a matrix of its dimensionality. E.g., x <- matrix(1:4, 2) c(x) [1] 1 2 3 4 So that's probably what happened to you. R has a somewhat odd feature of not really considering a pure vector as a column or row vector but being will

Re: [R] nested "for" loops

2011-11-05 Thread R. Michael Weylandt
No idea how this relates to what you said originally but glad you got it all worked out. And let us all reiterate: really, don't use nested for loops...there's a better way: promise! Michael On Sat, Nov 5, 2011 at 2:20 PM, nick_pan wrote: > I found the way out - it was because the borders of th

Re: [R] install.packages problem

2011-11-05 Thread Andrew Z
On Sat, Nov 5, 2011 at 2:47 PM, eric wrote: > I'm trying to install the rdatamarket package. I did an > install.packages('rdatamarket') command but got an error about half way > through the install as follows: > > * installing *source* package ‘RCurl’ ... > checking for curl-config... no > Cannot

Re: [R] Doing dist on separate objects in a text file

2011-11-05 Thread R. Michael Weylandt
Perhaps split() directly or more abstractly tapply() from base or one of the d_ply() from plyr? Michael On Sat, Nov 5, 2011 at 7:20 PM, ScottDaniel wrote: > So I have a text file that looks like this: >        "Label" "X"     "Y"     "Slice" > 1       "Field_1_R3D_D3D_PRJ_w617.tif"  348     506

Re: [R] nested "for" loops

2011-11-05 Thread Jeff Newmiller
Bert, this is not helpful. Since for loops and apply functions are not vectorized, why are you admonishing Carl that vectorizing doesn't always speed up algorithms? He didn't reference apply functions as being vectorized. But you seem to be doing so. I would assert that vectorizing DOES always

Re: [R] linear against nonlinear alternatives - quantile regression

2011-11-05 Thread Julia Lira
Dear David, Indeed rq() accepts a vector fo tau. I used the example given by Frank to run fitspl4 <- summary(rq(b1 ~ rcs(x,4), tau=c(a1,a2,a3,a4))) and it works. I even can use anova() to test equality of slopes jointly across quantiles. however, it would be interesting to test among differe

[R] Correlation between matrices

2011-11-05 Thread Kaiyin Zhong
> regions = c('cortex', 'hippocampus', 'brain_stem', 'mid_brain', 'cerebellum') > mice = paste('mouse', 1:5, sep='') > for (n in c('Cu', 'Fe', 'Zn', 'Ca', 'Enzyme')) { + assign(n, as.data.frame(replicate(5, rnorm(5 + } > names(Cu) = names(Zn) = names(Fe) = names(Ca) = names(Enzyme) = regions

[R] ANESRAKE package: Inappropriate error message, given the data

2011-11-05 Thread John Darrenwood
Hi, Attempting to use the "anesrake" raking (also referred to as rim weighting) package to weight survey data (Note: DATA is listed at the bottom along with SESSION INFO AND COMMANDS ARGUMENTS USED to allow you to reproduce the error). Presents following error message: *"Error in selecthighestpct

[R] Doing dist on separate objects in a text file

2011-11-05 Thread ScottDaniel
So I have a text file that looks like this: "Label" "X" "Y" "Slice" 1 "Field_1_R3D_D3D_PRJ_w617.tif" 348 506 1 2 "Field_1_R3D_D3D_PRJ_w617.tif" 359 505 1 3 "Field_1_R3D_D3D_PRJ_w617.tif" 356 524 1 4 "Field_1_R3D_D3D_PRJ_w617.tif" 2

Re: [R] nested "for" loops

2011-11-05 Thread nick_pan
I found the way out - it was because the borders of the vectors was close enough thats why I had the same result while I was adding points to the sequence. The example I gave was irrelevant but I made in order to find out that the problem was. Thank you all for your answers. -- View this message

[R] install.packages problem

2011-11-05 Thread eric
I'm trying to install the rdatamarket package. I did an install.packages('rdatamarket') command but got an error about half way through the install as follows: * installing *source* package ‘RCurl’ ... checking for curl-config... no Cannot find curl-config ERROR: configuration failed for package ‘

Re: [R] nested "for" loops

2011-11-05 Thread Bert Gunter
Carl: "Almost anything you can do in a for() loop can be done easier and faster with vectorization.-- " That is false: while this is certainly true for a great many basic vectorized operations, it is certainly false for most other things -- simulations are a typical example. Note that __ply type o

Re: [R] set seed for random draws

2011-11-05 Thread Md Desa, Zairul Nor Deana Binti
Thank you everybody for the helpful advices. Basically, I try to figure out why I get different numbers as there are more than one seed for a loop within a loop. Well, I guest I got it now. Because every time random seed is called or specified it'll output different random numbers, as it's requ

[R] testing significance of axis loadings from multivariate dudi.mix

2011-11-05 Thread Francisco Mora Ardila
Hi all I´m trying to tests the significance of loadings from a ordination of 46 variables (caategorical, ordinal and nominal). I used dudi.mix from ade4 for the ordination. A years ago Jari Oksanen wrote this script implementing Peres-Neto et al. 2003 (Ecology) bootstraping method: netobo

Re: [R] set seed for random draws

2011-11-05 Thread Rolf Turner
On 05/11/11 22:00, Patrick Burns wrote: I'd suggest two rules of thumb when coming up against something in R that you aren't sure about: 1. If it is a mundane task, R probably takes care of it. 2. Experiment to see what happens. Of course you could read documentation, but no one does that.

Re: [R] nested "for" loops

2011-11-05 Thread David Winsemius
You need to define "l" as a dimensioned object , either a vector or an array, and then assign the value of your calculation to the correctly indexed "location" in that object. Otherwise you are just overwriting the value each time through the loop. Use these help pages (and review "Introduction

Re: [R] error message

2011-11-05 Thread JulianaMF
Humm... I was using adegenet / ade4 packages and both R and R studio prompted the questions. Sorry, I did so many searches on R help and Adegenet help that I forgot to mention the packages I was using... Juliana -- View this message in context: http://r.789695.n4.nabble.com/error-message-tp32234

Re: [R] error message

2011-11-05 Thread R. Michael Weylandt
What prompted the questions? If it was a specifically biological/genetic package the bioconductor list can probably provide better help than this list. Michael On Nov 5, 2011, at 3:12 PM, JulianaMF wrote: > Hello Michael, > Sorry, I am just starting to lear all this. > Here is one of my input

Re: [R] error message

2011-11-05 Thread JulianaMF
Hello Michael, Sorry, I am just starting to lear all this. Here is one of my input files (from a .str file) in which the first column are the individuals, the second is the pop info (in this case I am stating that I have one pop because I am still trying to find out which are the clusters in my sam

Re: [R] Export to .txt

2011-11-05 Thread Greg Snow
Look at the txtStart function in the TeachingDemos package. It works like sink but also includes commands as well as output. Though I have never tried it with browser() (and it does not always include the results of errors). Another option in to use some type of editor that links with R such a

Re: [R] List of user installed packages

2011-11-05 Thread Erich Neuwirth
Running rownames(installed.packages()) will tell you the names of all packages of the version of R in which you are running the command. http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Add_002dOn-Packages tells you the names of the packages which were installed with R itself. On Nov 5, 2011, at

Re: [R] nested "for" loops

2011-11-05 Thread Carl Witthoft
If in fact this is homework, you will do yourself, your classmates, and possibly your teacher if you let them know that, at least in R, almost anything you can do in a for() loop can be done easier and faster with vectorization. If you teacher can't comprehend this, get him fired. a<-c(4,6,3)

Re: [R] linear against nonlinear alternatives - quantile regression

2011-11-05 Thread David Winsemius
I suppose this constitutes thread drift, but your simple example, Frank, made wonder if Rq() accepts a vector argument for tau. I seem to remember that Koencker's rq() does.. Normally I would consult the help page, but the power is still out here in Central Connecticut and I am corresponding wit

Re: [R] unsuscribe

2011-11-05 Thread David Winsemius
Although it is possible to communicate with the list server via email, most people have better luck with the web interface. That applies with even greater force when the person is unable to spell the server commands. https://stat.ethz.ch/mailman/options/r-help -- David. On Nov 5, 2011, at 10:40

[R] 3-D ellipsoid equations update2. Error message when I run R code.

2011-11-05 Thread mmstat
+ Hello, I want to delete prior questions online but am getting an error message? Please see R code in enclosed file. I don't understand the error message. The parametric equations of an ellipsoid can be written in terms of spherical coordinates. The three spherical coor

Re: [R] List of user installed packages

2011-11-05 Thread R. Michael Weylandt
I think the installed.packages() function can give you what you need, specifically look at the priority argument. Also check this out http://stackoverflow.com/questions/1401904/painless-way-to-install-a-new-version-of-r Michael On Sat, Nov 5, 2011 at 9:37 AM, Cem Girit wrote: > Hello, > > > >  

Re: [R] similar package in R like "SKEW CALCULATOR"?

2011-11-05 Thread Ben Bolker
David Winsemius comcast.net> writes: > > From that hand waving description it would be difficult to tell. Sounds like a reinvention of the Pareto > Index, for which you can find many packages that provide facilities: > > http://finzi.psych.upenn.edu/cgi-bin/namazu.cgi?query=Pareto+index&max=100

[R] List of user installed packages

2011-11-05 Thread Cem Girit
Hello, I am going to install the new version of R 2.14.1. After the installation, I want to copy my installed packages to the new library. But since over time I forgot which ones I installed I want to get a list of all the packages I installed among the packages installed initia

Re: [R] linear against nonlinear alternatives - quantile regression

2011-11-05 Thread Frank Harrell
Just to address a piece of this - in the case in which you are currently focusing on only one quantile, the rms package can help by fitting restricted cubic splines for covariate effects, and then run anova to test for nonlinearity (sometimes a dubious practice because if you then remove nonlinear

[R] unsuscribe

2011-11-05 Thread Jimmy Barrera
^_^ > From: dwinsem...@comcast.net > Date: Fri, 4 Nov 2011 22:02:13 -0400 > To: peter.langfel...@gmail.com > CC: r-help@r-project.org; christian.langk...@gmxpro.de > Subject: Re: [R] 12th Root of a Square (Transition) Matrix > > This is just one of many 12-th roots. (Peter knows this i'm sur

Re: [R] zoo performance regression noticed (1.6-5 is faster...)

2011-11-05 Thread Gabor Grothendieck
On Fri, Nov 4, 2011 at 1:02 PM, Gabor Grothendieck wrote: > On Fri, Nov 4, 2011 at 12:56 PM, Gabor Grothendieck > wrote: >> On Fri, Nov 4, 2011 at 12:34 PM, James Marca >> wrote: >>> Good morning, >>> >>> I have discovered what I believe to be a performance regression >>> between Zoo 1.6x and Zo

Re: [R] nested "for" loops

2011-11-05 Thread R. Michael Weylandt
Why do you need to do it with nested for loops? It is of course possible - and I hinted how to do it in my first email - but there's no reason as far as I can see to do so, particularly as a means of MLE. Sounds suspiciously like homework... Michael On Nov 4, 2011, at 10:14 PM, nick_pan wrote

[R] Error in eigen(a$hessian) : infinite or missing values in 'x'

2011-11-05 Thread Kristian Lind
Dear R-users, I'm estimating a two- dimensional state-space model using the FKF package. The resulting log likelihood function is maximized using auglag from the Alabama package. The procedure works well for a subset of my data, but if I try to use the entire data set I get the following error mes

[R] linear against nonlinear alternatives - quantile regression

2011-11-05 Thread Julia Lira
Dear all, I would like to know whether any specification test for linear against nonlinear model hypothesis has been implemented in R using the quantreg package. I could read papers concerning this issue, but they haven't been implemented at R. As far as I know, we only have two specificatio

Re: [R] similar package in R like "SKEW CALCULATOR"?

2011-11-05 Thread David Winsemius
>From that hand waving description it would be difficult to tell. Sounds like a >reinvention of the Pareto Index, for which you can find many packages that >provide facilities: http://finzi.psych.upenn.edu/cgi-bin/namazu.cgi?query=Pareto+index&max=100&result=normal&sort=score&idxname=functions&i

Re: [R] How to write a shapefile with projection

2011-11-05 Thread Patrick Giraudoux
Hi, Sorry i have put such a detailed question to the list about writing a shapefile with projection. I realized that if i use writeOGR from rgdal and not the other write shapefile functions i can get a shapefile with projection recognized by ArcGIS. The command is (in case anybody wonders): ?

[R] similar package in R like "SKEW CALCULATOR"?

2011-11-05 Thread Knut Krueger
Hi to all is there a similar package like the SKEW CALCULATOR from Peter Nonacs (University of California - Department of Ecology and Evolutionary Biology) http://www.eeb.ucla.edu/Faculty/Nonacs/shareware.htm Kind Regards Knut __ R-help@r-project

Re: [R] 3-D ellipsoid equations

2011-11-05 Thread mmstat
+ Hello, The parametric equations of an ellipsoid can be written in terms of spherical coordinates. The three spherical coordinates are converted to Cartesian coordinates by X=a cos (α) sin(θ) Y=b sin(α) sin(θ) Z=c cos(θ) for α and θ The parameter α varies fr

Re: [R] set seed for random draws

2011-11-05 Thread Patrick Burns
I'm suspecting this is confusion about default behavior. R automatically updates the random seed when random numbers are generated (or other random operations are performed). The original poster may have experienced systems where it is up to the user to change the seed. I'd suggest two rules of

Re: [R] nested "for" loops

2011-11-05 Thread nick_pan
Thank you , this works but I have to do it with nested for loops... Could you suggest me a way ? -- View this message in context: http://r.789695.n4.nabble.com/nested-for-loops-tp3992089p3992324.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] HoltWinters in R 2.14.0

2011-11-05 Thread TimothyDalbey
You are 100% correct by my estimation however I suppose I am looking for the conditions in the data that might cause the optim() or optimize() functions to fail. I took a brief tour of the HoltWinters source but the code available (readable) online seemed outdated (by way of conflicting descrip