Re: [R] Data formatting for matplot

2009-09-27 Thread Tim Clark
Henrique, Thanks for the suggestion. I think I may not understand matplot() because the graph did not come out like it should have. Gabor suggested: library(lattice) xyplot(y ~ x, mydat, groups = id) Which gave what I was looking for. Is there a way to get matplot() to give the same graph?

Re: [R] Fwd: generic methods - in particular the summary function

2009-09-27 Thread Christophe Dutang
Thanks for your answer. Yes, I use now a proper NAMESPACE with function declared correctly. Christophe Le 27 sept. 2009 à 19:16, David Winsemius a écrit : On Sep 27, 2009, at 12:52 PM, Christophe Dutang wrote: Nobody wants to answer my question... is there something stupid in it? I coul

Re: [R] Re ading Functions that are in a Vector

2009-09-27 Thread Rolf Turner
On 28/09/2009, at 4:30 PM, David Winsemius wrote: On Sep 27, 2009, at 11:07 PM, Rolf Turner wrote: On 28/09/2009, at 3:36 PM, trumpetsaz wrote: I am trying to write a function that will have an input of a vector of functions. Here is a simplistic example. sumstats <- c(mean,sd) sumstats[

Re: [R] Re ading Functions that are in a Vector

2009-09-27 Thread David Winsemius
On Sep 27, 2009, at 11:07 PM, Rolf Turner wrote: On 28/09/2009, at 3:36 PM, trumpetsaz wrote: I am trying to write a function that will have an input of a vector of functions. Here is a simplistic example. sumstats <- c(mean,sd) sumstats[1] #Gives this error #> sumstats[1] #[[1]] #functi

Re: [R] Re ading Functions that are in a Vector

2009-09-27 Thread Rolf Turner
On 28/09/2009, at 3:36 PM, trumpetsaz wrote: I am trying to write a function that will have an input of a vector of functions. Here is a simplistic example. sumstats <- c(mean,sd) sumstats[1] #Gives this error #> sumstats[1] #[[1]] #function (x, ...) #UseMethod("mean") # I thought about restr

Re: [R] Re ading Functions that are in a Vector

2009-09-27 Thread Gabor Grothendieck
On Sun, Sep 27, 2009 at 10:36 PM, trumpetsaz wrote: > > I am trying to write a function that will have an input of a vector of > functions. Here is a simplistic example. > sumstats <- c(mean,sd) > sumstats[1] > #Gives this error > #> sumstats[1] > #[[1]] > #function (x, ...) > #UseMethod("mean") >

Re: [R] Data formatting for matplot

2009-09-27 Thread Gabor Grothendieck
Try this: library(lattice) xyplot(y ~ x, mydat, groups = id) On Sun, Sep 27, 2009 at 10:42 PM, Tim Clark wrote: > Dear List, > > I am wanting to produce a multiple line plot, and know I can do it with > matplot but can't get my data in the format I need.  I have a dataframe with > three colum

Re: [R] implementation of matrix logarithm (inverse of matrix exponential)

2009-09-27 Thread Charles C. Berry
On Sun, 27 Sep 2009, Douglas Bates wrote: There is a logm function in the expm package in the expm project on R-forge. See http://expm.R-forge.R-project.org/ Martin was the person who added that function so I will defer to his explanations of what it does. I know he has been traveling and it

Re: [R] Data formatting for matplot

2009-09-27 Thread Henrique Dallazuanna
You can try this: matplot(do.call(cbind, split.dat)) On Sun, Sep 27, 2009 at 11:42 PM, Tim Clark wrote: > Dear List, > > I am wanting to produce a multiple line plot, and know I can do it with > matplot but can't get my data in the format I need.  I have a dataframe with > three columns; indiv

[R] Data formatting for matplot

2009-09-27 Thread Tim Clark
Dear List, I am wanting to produce a multiple line plot, and know I can do it with matplot but can't get my data in the format I need. I have a dataframe with three columns; individuals ID, x, and y. I have tried split() but it gives me a list of matrices, which is closer but not quite what I

[R] Re ading Functions that are in a Vector

2009-09-27 Thread trumpetsaz
I am trying to write a function that will have an input of a vector of functions. Here is a simplistic example. sumstats <- c(mean,sd) sumstats[1] #Gives this error #> sumstats[1] #[[1]] #function (x, ...) #UseMethod("mean") # I thought about restricting the input to character variables such as

Re: [R] Converting SAS Data code to R.

2009-09-27 Thread David Winsemius
On Sep 27, 2009, at 6:01 PM, David Winsemius wrote: On Sep 27, 2009, at 12:10 PM, David Winsemius wrote: On Sep 27, 2009, at 11:49 AM, Douglas Bates wrote: On Sat, Sep 26, 2009 at 11:33 PM, David Winsemius wrote: I am contemplating bringing in and merging three NHANES-III datasets from

Re: [R] Data analysis package for positively skewed data

2009-09-27 Thread KABELI MEFANE
R-helpers   A curious question: Can you make suggestions  as to  what to use in R for the data from a sample of the following:   Hypermarket <- matrix(rnorm(100, mean=5, sd=5000)) Supermarket <- matrix(rnorm(400, mean=34000, sd=3000)) Minimarket  <- matrix(rnorm(1000, mean=1,sd=2000)) Corn

Re: [R] Strata formation using R

2009-09-27 Thread KABELI MEFANE
Hi Everybody   Its me again. I have been able to sample using SRS and stratified sampling when i have predefined groups as follows:   Hypermarket <- matrix(rnorm(100, mean=5, sd=5000)) Supermarket <- matrix(rnorm(400, mean=34000, sd=3000)) Minimarket  <- matrix(rnorm(1000, mean=1,sd=2000))

[R] Bubble Plot

2009-09-27 Thread Marion Wittmann
Hello, I am using the bubble plot and have been able to overlay two different data sets on the same graphic successfully. I would like to do the following and cannot: 1) suppress the zero values such that there is no representation of them on my plot (i.e., the "zeroes" show up as the small

Re: [R] Count number of zeros in a collumn

2009-09-27 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Murat Tasan > Sent: Sunday, September 27, 2009 4:27 PM > To: r-help@r-project.org > Subject: Re: [R] Count number of zeros in a collumn > > more generally, if you want to test fo

Re: [R] Determining name of calling function.

2009-09-27 Thread Rolf Turner
On 28/09/2009, at 12:34 PM, Gabor Grothendieck wrote: Not sure if this is important to you but R functions don't have to have names so what you get back won't be a name if the function was anonymous. In the example below an anonymous function calls fname and the returned string is the calling

[R] CRAN (and crantastic) updates this week

2009-09-27 Thread Crantastic
CRAN (and crantastic) updates this week New packages * bdoc (1.0) Michael Anderson http://crantastic.org/packages/bdoc This package contains a function that will classify DNA barcodes as well as a few test and reference data sets. * bdsmatrix (1.0) Terry Therneau http:/

Re: [R] Determining name of calling function.

2009-09-27 Thread Gabor Grothendieck
Not sure if this is important to you but R functions don't have to have names so what you get back won't be a name if the function was anonymous. In the example below an anonymous function calls fname and the returned string is the calling sequence but that's not its name since it has no name. In

Re: [R] Count number of zeros in a collumn

2009-09-27 Thread Murat Tasan
more generally, if you want to test for some minimum threshold T on the number of zeros, try: > if(length(which(dart[,1977] == 0)) < T) { # some code to handle the > too-few-zeros-case } On Sep 27, 4:54 pm, Marcio Resende wrote: > I have a matrix 700x2000 which is sampled in each cycle from

Re: [R] dimension-preserving matrix coersion

2009-09-27 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Murat Tasan > Sent: Sunday, September 27, 2009 3:59 PM > To: r-help@r-project.org > Subject: [R] dimension-preserving matrix coersion > > i've written a function to coerce a mat

Re: [R] array to matrix or data.frame

2009-09-27 Thread Daniel Malter
Works a charme; thanks much everybody. Daniel. David Winsemius wrote: > > > On Sep 27, 2009, at 6:33 PM, Daniel Malter wrote: > >> >> Hi, I have an array of dimension 6:6:16. I want to stack the >> 16 >> slices of the array into a matrix or a data frame of dimension >> 6:(6*16=9

[R] Determining name of calling function.

2009-09-27 Thread Rolf Turner
I have vague recollections of seeing this question discussed on r-help previously, but I can't find the relevant postings. I want to determine (from within a given function) the name of the function calling that given function. E.g. if I have a function foo() which calls a function bar(), an

Re: [R] dimension-preserving matrix coersion

2009-09-27 Thread Murat Tasan
HA! yeah, that'll do it! forgot that mode() can be used to set modes as well as get them. thanks much! -murat On Sep 27, 7:10 pm, jim holtman wrote: > How about this: > > > m <- matrix(c(0, 1, 1, 0), ncol = 2) > > mode(m) <- 'logical' > > m > >       [,1]  [,2] > [1,] FALSE  TRUE > [2,]  TRUE

Re: [R] dimension-preserving matrix coersion

2009-09-27 Thread jim holtman
How about this: > m <- matrix(c(0, 1, 1, 0), ncol = 2) > mode(m) <- 'logical' > m [,1] [,2] [1,] FALSE TRUE [2,] TRUE FALSE > On Sun, Sep 27, 2009 at 6:59 PM, Murat Tasan wrote: > i've written a function to coerce a matrix (e.g. from numeric to > logical), but i'd like to know if someo

Re: [R] rsolnp- Error (Help!)

2009-09-27 Thread jim holtman
It means that your expression "max(tt[2] - 10 * tol, nineq)" is returning NA: Notice I get the same error: > if (1==1)1 [1] 1 > if (NA == 1) 1 Error in if (NA == 1) 1 : missing value where TRUE/FALSE needed Check your script and see why it is NA. you might need: max(tt[2] - 10 * tol, nineq, na

Re: [R] array to matrix or data.frame

2009-09-27 Thread Rolf Turner
On 28/09/2009, at 11:51 AM, David Winsemius wrote: apply(x, 2 , I) ***Much*** sexier than my solution! cheers, Rolf Turner ## Attention:\ This e-mail message is privileged and co

[R] dimension-preserving matrix coersion

2009-09-27 Thread Murat Tasan
i've written a function to coerce a matrix (e.g. from numeric to logical), but i'd like to know if someone has a more elegant method for this: > m <- matrix(c(0, 1, 1, 0), ncol = 2) > m <- as.logical(m) > m [1] FALSE TRUE TRUE FALSE i'd like 'm' to still be a matrix with the original dimensions.

Re: [R] array to matrix or data.frame

2009-09-27 Thread Gabor Grothendieck
Try this: matrix(aperm(x, c(1,3,2)), nc = 6) On Sun, Sep 27, 2009 at 6:33 PM, Daniel Malter wrote: > > Hi, I have an array of dimension 6:6:16. I want to stack the 16 > slices of the array into a matrix or a data frame of dimension > 6:(6*16=96) in order to write it to a csv fil

Re: [R] array to matrix or data.frame

2009-09-27 Thread David Winsemius
On Sep 27, 2009, at 6:33 PM, Daniel Malter wrote: Hi, I have an array of dimension 6:6:16. I want to stack the 16 slices of the array into a matrix or a data frame of dimension 6:(6*16=96) in order to write it to a csv file. It seems I cannot get the matrix or data.frame f

[R] array to matrix or data.frame

2009-09-27 Thread Daniel Malter
Hi, I have an array of dimension 6:6:16. I want to stack the 16 slices of the array into a matrix or a data frame of dimension 6:(6*16=96) in order to write it to a csv file. It seems I cannot get the matrix or data.frame functions to put the values from the array in the same order

Re: [R] implementation of matrix logarithm (inverse of matrix exponential)

2009-09-27 Thread Douglas Bates
There is a logm function in the expm package in the expm project on R-forge. See http://expm.R-forge.R-project.org/ Martin was the person who added that function so I will defer to his explanations of what it does. I know he has been traveling and it may be a day or two before he can get to this

Re: [R] Converting SAS Data code to R.

2009-09-27 Thread David Winsemius
On Sep 27, 2009, at 12:10 PM, David Winsemius wrote: On Sep 27, 2009, at 11:49 AM, Douglas Bates wrote: On Sat, Sep 26, 2009 at 11:33 PM, David Winsemius wrote: I am contemplating bringing in and merging three NHANES-III datasets from the National Center for Health Statistics that are fix

Re: [R] RSQLite column names underscores

2009-09-27 Thread Gabor Grothendieck
You are probably trying to use SQL reserved keywords as column names. Try entering this at the R prompt: library(RSQLite) .SQL92Keywords On Sun, Sep 27, 2009 at 5:25 PM, Christopher Bare wrote: > Hi, > > When I use RSQLite's dbWriteTable(...) function, the columns in the db > table frequently en

[R] rsolnp- Error (Help!)

2009-09-27 Thread tushar_kul
Hi I am relatively new to R and was trying to run an optimization problem using rsolnp. I am getting an error which seems to be not related to my construct of the optimization equations. Error in if (max(tt[2] - 10 * tol, nineq) <= 0) rho = 0 : missing value where TRUE/FALSE needed I have

[R] RSQLite column names underscores

2009-09-27 Thread Christopher Bare
Hi, When I use RSQLite's dbWriteTable(...) function, the columns in the db table frequently end up having "__1" (two underscores and a one) added to them. The names are unique within the table and contain no weird characters. For example a "position" column from a data.frame was written to the DB

Re: [R] Count number of zeros in a collumn

2009-09-27 Thread milton ruser
Hi Marcio, How about if (min(dart[,1977])==0)... cheers milton On Sun, Sep 27, 2009 at 4:54 PM, Marcio Resende wrote: > > I have a matrix 700x2000 which is sampled in each cycle from another matrix > 788x2000 with the numbers 0,1 and 9 > > There is one specific collumn of this matrix, dart[,197

Re: [R] QQ plotting of various distributions...

2009-09-27 Thread Eric Thompson
It seems I misunderstood Sunil's response and somewhat freaked out because it appeared that he was giving the wrong method for making a QQ plot, but was actually demonstrating the sampling variability. My apologies to Sunil. 2009/9/27 Duncan Murdoch : > Eric Thompson wrote: >> >> The supposed ex

[R] Count number of zeros in a collumn

2009-09-27 Thread Marcio Resende
I have a matrix 700x2000 which is sampled in each cycle from another matrix 788x2000 with the numbers 0,1 and 9 There is one specific collumn of this matrix, dart[,1977], that usually, after the samplimg procedure has only 1 and 9 (because the zero frequency in this collumn is low). However, when

Re: [R] Check value interval in a if loop

2009-09-27 Thread Jim Lemon
Lucas Sevilla García wrote: Hi R community I have a little problem, and I tried to solve it by myself but I couldn't. I building an if loop, and I want to check a value inside an interval. This would be the case: pvalue=0,2999 if(pvalue>0.05 or pvalue<0.1) as you can see I would like to ch

[R] View this page "R-Packages (Statistical Computing)"

2009-09-27 Thread dataguru
Click on http://groups.google.com/group/r-help-archive/web/r-packages-statistical-computing - or copy & paste it into your browser's address bar if that doesn't work. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

[R] View this page "R-Packages (Statistical Computing)"

2009-09-27 Thread dataguru
Click on http://groups.google.com/group/r-help-archive/web/r-packages-statistical-computing - or copy & paste it into your browser's address bar if that doesn't work. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

[R] Clustering with R - efficient processing of large sparse data sets (text data)

2009-09-27 Thread dataguru
I checked the R procedure HCLUST (hierarchical clustering) but it looks like it requires a full triangular n x n similarity matrix as input, where n = number of observations. The number of variables is 200. My data set has n = 50,000 observations (keywords), and I use ad-hoc similarity measures, n

Re: [R] Check value interval in a if loop

2009-09-27 Thread Marcio Resende
Hi Lucas, try: if(pvalue>0.05 & pvalue<0.1) HTH Marcio Lucas Sevilla García wrote: > > > Hi R community > > I have a little problem, and I tried to solve it by myself but I couldn't. > I building an if loop, and I want to check a value inside an interval. > This would be the case: > > pv

[R] Clustering with R - efficient processing of large sparse data sets (text data)

2009-09-27 Thread dataguru
I checked the R procedure HCLUST (hierarchical clustering) but it looks like it requires a full triangular n x n similarity matrix as input, where n = number of observations. The number of variables is 200. My data set has n = 50,000 observations (keywords), and I use ad-hoc similarity measures, n

Re: [R] Problem with downloading workspace file from a web address

2009-09-27 Thread Paul Smith
2009/9/27 Uwe Ligges : >> To load a previously saved workspace, one can do the following: >> >> load("/path/to/the/saved/workspace/file") >> >> However, if the path to the saved workspace file is a web address, one >> gets the following error: >> >> «Error in readChar(con, 5L, useBytes = TRUE) : ca

Re: [R] R CMD INSTALL --build: Folders /inst and /etc not in zip-file and WindowsXP locks /library/[package]/etc/

2009-09-27 Thread Uwe Ligges
Tobias Schoch wrote: Dear R users, My set-up: OS=Windows XP, R-2.9.2, Rtools210 I faced the follwing problem with the package compilation: There is no "/inst" or "/etc" subdirectory in the package-zip-file. And the content of the "/etc" subdirectory is lost, too. I tried a simplified "test" pa

Re: [R] Check value interval in a if loop

2009-09-27 Thread Uwe Ligges
Lucas Sevilla García wrote: Hi R community I have a little problem, and I tried to solve it by myself but I couldn't. I building an if loop, and I want to check a value inside an interval. This would be the case: pvalue=0,2999 if(pvalue>0.05 or pvalue<0.1) as you can see I would like to c

[R] constraining covariance structure for random effects in lme

2009-09-27 Thread Nisha C. Gottfredson
I would like to impose a unique structure on the random effects covariance matrix in a multilevel model (i.e., a structure that is not included in the standard pdMat classes listed in Table 4.3 of Pinheiro and Bates' lme book). Is there any way to manually impose equality constraints on the el

Re: [R] How to open only one file in a .gz file?

2009-09-27 Thread Yihui Xie
gzfile() can handle a single file in *.gz. If you want to read one of the files in a bunch of files, you may as well extract them first using "tar -zxvf yourarchive.tar.gz" (sounds like a stupid solution), or if you only want to use R, system() could help, e.g. system("tar -zxvf yourarchive.tar.gz"

[R] xtable - how to add a "sum of values in a row" column?

2009-09-27 Thread Ken-JP
Hi, I saw this example for 2.10 Time series in the xtable gallery documentation. http://cran.r-project.org/web/packages/xtable/vignettes/xtableGallery.pdf How would I add a column at the end "Total" which sums the row, with minimal changes to the code below? Thanks in advance. - Ken 2.10 Ti

[R] Check value interval in a if loop

2009-09-27 Thread Lucas Sevilla García
Hi R community I have a little problem, and I tried to solve it by myself but I couldn't. I building an if loop, and I want to check a value inside an interval. This would be the case: pvalue=0,2999 if(pvalue>0.05 or pvalue<0.1) as you can see I would like to check in that if loop if my pval

Re: [R] error while plotting

2009-09-27 Thread Uwe Ligges
Nair, Murlidharan T wrote: I am getting the following errors when I am trying to plot the data below. I cannot figure out the error. Error in plot.window(...) : need finite 'xlim' values In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) :

Re: [R] Fwd: generic methods - in particular the summary function

2009-09-27 Thread David Winsemius
On Sep 27, 2009, at 12:52 PM, Christophe Dutang wrote: Nobody wants to answer my question... is there something stupid in it? I couldn't really say. Not being a user of fitdistrplus I don't have much baseline experience. Had you posted code that produced something to work on, I might hav

Re: [R] How to open only one file in a .gz file?

2009-09-27 Thread Uwe Ligges
Peng Yu wrote: Hi, Suppose that there are multiple files in a .gz file. Well, the extension .gz regularly stand for a (single) gzip compressed file. Tyoically you will find more tan one file in a tar archive or a zip compressed archive. For the latter see ?unz. Uwe Ligges How to open

Re: [R] NLM

2009-09-27 Thread Uwe Ligges
Andrew Wang wrote: I am trying to understand NLM package, so I generated this data set consisting y and x using y= a + b*x +c*x^2 + N(0,10), with a=3.5,b=4.5,c=5.5 Given y and x, I am trying to use NLM to have estimates of parameters a, b and c that minimize the least square error my co

Re: [R] Fwd: generic methods - in particular the summary function

2009-09-27 Thread Uwe Ligges
Christophe Dutang wrote: Nobody wants to answer my question... is there something stupid in it? Maybe, or maybe just too much traffic on the lists these days. Début du message réexpédié : De : Christophe Dutang Date : 19 septembre 2009 11:26:51 HAEC À : r-help@r-project.org Objet : gene

[R] Fwd: generic methods - in particular the summary function

2009-09-27 Thread Christophe Dutang
Nobody wants to answer my question... is there something stupid in it? Début du message réexpédié : > De : Christophe Dutang > Date : 19 septembre 2009 11:26:51 HAEC > À : r-help@r-project.org > Objet : generic methods - in particular the summary function > > Hi all, > > I'm currently working on

Re: [R] implementation of matrix logarithm (inverse of matrix exponential)

2009-09-27 Thread Charles C. Berry
On Sat, 26 Sep 2009, spencerg wrote: Sylvester's formula (http://en.wikipedia.org/wiki/Sylvester%27s_formula) applies to a square matrix A = S L solve(S), where L = a diagonal matrix and S = matrix of eigenvectors. Let "f" be an analytic function [for which f(A) is well defined]. Then f(

Re: [R] Select.spatial on spplots

2009-09-27 Thread cls59
Julius Tesoro wrote: > > Hi everyone. I posted this on R-sig-geo but got no response. > > > Can select.spatial() be used in an existing spplot? I have tried selecting > points (eq) from a plot generated from sp. However, when I invoke > select.spatial(eq). It generates only the points witho

Re: [R] for cycle with uncontinuous numbers

2009-09-27 Thread David Winsemius
You did not make "test" large enough to accept an index of 50 or any of the other numbers in x for that matter. On the first pass through that loop you to assigned to the 50 to the 50th element in test. If you wanted to assign 50 to the first element of test the you should look at the seq_a

Re: [R] Converting SAS Data code to R.

2009-09-27 Thread David Winsemius
On Sep 27, 2009, at 11:49 AM, Douglas Bates wrote: On Sat, Sep 26, 2009 at 11:33 PM, David Winsemius wrote: I am contemplating bringing in and merging three NHANES-III datasets from the National Center for Health Statistics that are fixed format with record length=3348, line counts around

Re: [R] Problem with downloading workspace file from a web address

2009-09-27 Thread Uwe Ligges
Paul Smith wrote: Dear All, To load a previously saved workspace, one can do the following: load("/path/to/the/saved/workspace/file") However, if the path to the saved workspace file is a web address, one gets the following error: «Error in readChar(con, 5L, useBytes = TRUE) : cannot open t

Re: [R] QQ plotting of various distributions...

2009-09-27 Thread Petar Milin
Thanks all! I did not want to cause any trouble and, God forbid, offense. I thought, I asked a simple question to improve my understanding and R-skills. It seems that there ain't single gospel truth about QQs. :-) Thanks, again! Best, PM Juliet Hannah wrote: I think it's helpful to show the

Re: [R] Optional libraries (libtiff, etc) not found

2009-09-27 Thread David Winsemius
There is sufficient circumstantial evidence to suggest you are posting in the wrong mailing list. Follow-up should go there. You also have not posted sessionInfo() output or the error messages you are getting when that "didn't work". You should post in R-SIG-Mac and include the appropriat

Re: [R] for cycle with uncontinuous numbers

2009-09-27 Thread Marcio Resende
Dear John, What I am trying to do is a genetic analysis and the "i" in my cycle are the numbers of markers I am testing. I know the code is not right, but what i wanted to do was to fill this 6 row matrix with the numbers in x So basically I wanted the cycle to loop only with the values on x (50,1

Re: [R] Converting SAS Data code to R.

2009-09-27 Thread Douglas Bates
On Sat, Sep 26, 2009 at 11:33 PM, David Winsemius wrote: > I am contemplating bringing in and merging three NHANES-III datasets from > the National Center for Health Statistics that are fixed format with record > length=3348, line counts around 20,000 and described by SAS DATA steps. I > have down

[R] Generation of Multariate Gumbel Random Numbers VGAM or GUMBEL

2009-09-27 Thread Cristian Angelo Guevara
Dear R users: I'm trying to generate multivariate random numbers where some variables are correlated. I tried VGAM and GUMBEL, but I really don't understand from the documentation, how to move from the single random to the multivariate. Does anybody have any insight about about this? Thanks in ad

Re: [R] for cycle with uncontinuous numbers

2009-09-27 Thread jim holtman
It is unclear exactly what you are trying to do. Since your 'test' matrix is only 6 rows in length, then when you extend it by trying to store into 50 for example, it will fill in the rest of the new values with NA. Can you explain what you think the code is supposed to do? It is doing exactly wh

Re: [R] zoo: merging aggregated zoo-objects fails

2009-09-27 Thread Gabor Grothendieck
Please read the last line to every message on r-help. In particular make it reproducible and minimal. The code you post should look like this where you have cut down DF1, DF2 and DF3 to the smallest number of rows that still exhibits the error. DF1 <- ...output from dput(DF1) DF2 <- ...outpu

[R] Optional libraries (libtiff, etc) not found

2009-09-27 Thread Wayne F
I installed the (binary) biOps package, which can use libtiff and libfftw. Then I used macports to install the libraries (in /opt/local/lib). But I restart R and biOps still does not see the libraries. I've tried adding symbolic links from /opt/local/lib to /usr/local/lib, I've added /opt/local/l

[R] Xterm escape sequences in Prompt

2009-09-27 Thread Dan DEDIU
Dear list, I would like to know if there is any way to include xterm escape sequences in R's prompt using options( prompt= XXX, continue= XXX ), where XXX can contain, for example, "\033[1;31mRed" for chancing text color to red (see http://www.frexx.de/xterm-256-notes/). If you do this, the co

Re: [R] Problem with Random Forest predict

2009-09-27 Thread Chrysanthi A.
Dear all, I am working with randomForest package and I am interested in examining the "Gini importance" measures that are used as a general indicator of feature relevance. Is there a possibility of getting the Gini measure that is being estimated in each tree by the output of the getTree() functio

[R] Gini importance measure in RF package

2009-09-27 Thread Chrysanthi A.
Dear all, I am working with randomForest package and I am interested in examining the "Gini importance" measures that are used as a general indicator of feature relevance. Is there a possibility of getting the Gini measure that is being estimated in each tree by the output of the getTree() functio

Re: [R] for cycle with uncontinuous numbers

2009-09-27 Thread Marcio Resende
Hi Tobias, thanks for the help, the code I am using is quite long, but basically what I tried to do was test <- matrix(0,6,1) x <- matrix( c(50,100,200,300,900,2343) ,ncol = 1) for (i in x){ test [i] <- (i) } but this code returns NA for all the elements which are not x Tobias Verbeke-2 w

[R] zoo: merging aggregated zoo-objects fails

2009-09-27 Thread gunnar.p
Dear all, I have several text files looking like this: 9063032 19700201 22:00 174.067 9063032 19700201 23:00 174.076 9063032 19700202 00:00 174.085 9063032 19700202 01:00 174.091 9063032 19700202 02:00 174.094 9063032 19700202 03:00 174.091 9063032 19700202 04:00 174.082 9063032 19

Re: [R] Adding variables

2009-09-27 Thread Gabor Grothendieck
Note that Henrique's code does not give the same result as the expression you posted although its possible that his is what you really intended. On Sun, Sep 27, 2009 at 10:27 AM, tzygmund mcfarlane wrote: > Thank you Gabor (& Henrique)! > > On Sun, Sep 27, 2009 at 3:26 PM, Gabor Grothendieck > w

Re: [R] QQ plotting of various distributions...

2009-09-27 Thread Juliet Hannah
I think it's helpful to show the sampling variability in a QQ plot under repeated sampling. An example is given in Venables, Ripley pg 86. The variance is higher at the tails. Even when the distributions are the same, the QQ plot does not have to resemble a straight line because of sampling. I don'

Re: [R] Adding variables

2009-09-27 Thread tzygmund mcfarlane
Thank you Gabor (& Henrique)! On Sun, Sep 27, 2009 at 3:26 PM, Gabor Grothendieck wrote: > with(attenu, mag + as.numeric(station)) > > is nearly twice as fast: > >> system.time(for(i in 1:1000) with(attenu, mag + as.numeric(station))) >   user  system elapsed >   0.05    0.02    0.06 > >> system.

Re: [R] Adding variables

2009-09-27 Thread Gabor Grothendieck
with(attenu, mag + as.numeric(station)) is nearly twice as fast: > system.time(for(i in 1:1000) with(attenu, mag + as.numeric(station))) user system elapsed 0.050.020.06 > system.time(for(i in 1:1000) rowSums(cbind(mag, station))) user system elapsed 0.090.000.10 S

Re: [R] Adding variables

2009-09-27 Thread tzygmund mcfarlane
> So why were you trying to add a factor variable to a numeric, anyway? For no other reason than to illustrate the task of addition. It is, admittedly, meaningless. > Well, I had never seen any help pages use "attenu" as an example. I literally went to: http://stat.ethz.ch/R-manual/R-patched/lib

Re: [R] Adding variables

2009-09-27 Thread Henrique Dallazuanna
The station column has non numeric values, so you need convert to numeric before: with(attenu, as.numeric(as.character(station)) + mag) On Sun, Sep 27, 2009 at 8:47 AM, tzygmund mcfarlane wrote: > Jim, > > Both my emails contained reproducible code (the first one wasn't > completely reproducible

Re: [R] Adding variables

2009-09-27 Thread David Winsemius
Well, I had never seen any help pages use "attenu" as an example. Like Jim I assumed that you were offering code that was operating on some private copy of data, If you look at the number of datasets, I think it unreasonable to expect the great majority of potentially helpful persons to kno

[R] Gini importance measure in RF package

2009-09-27 Thread Chrysanthi A.
Dear all, I am working with randomForest package and I am interested in examining the "Gini importance" measures that are used as a general indicator of feature relevance. Is there a possibility of getting the Gini measure that is being estimated in each tree by the output of the getTree() functio

Re: [R] Re ad in multiple datasets

2009-09-27 Thread Gabor Grothendieck
Try this: filenames <- sprintf("data%d.csv", 1:20) DFs <- sapply(filenames, read.csv, simplify = FALSE) which will return a list of data frames, DFs, each named by its filename so that DFs[[1]] or DFs[["data1.csv"]] give the data frame read from data1.csv, etc. and names(DFs) gives a vector of th

Re: [R] QQ plotting of various distributions...

2009-09-27 Thread Duncan Murdoch
Eric Thompson wrote: The supposed example of a Q-Q plot is most certainly not how to make a Q-Q plot. I don't even know where to start First off, the two "Q:s in the title of the plot stand for "quantile", not "random". The "answer" supplied simply plots two sorted samples of a distribution

Re: [R] Adding variables

2009-09-27 Thread tzygmund mcfarlane
Jim, Both my emails contained reproducible code (the first one wasn't completely reproducible - it required one to know that "attenu" is a base R dataset). Anyway, thanks for your help. On Sat, Sep 26, 2009 at 8:11 PM, jim holtman wrote: > I assumed (since you did not provide reproducible code)

Re: [R] panel.text question

2009-09-27 Thread Felix Andrews
Use packet.number() to identify which data subset you are dealing with (inside the panel function): xyplot(y~x|a, panel=function(...){ panel.loess(...) panel.text(0,2,label=c('best','better','bad','worst')[packet.number()]) }) There is also panel.number() which is similar but

Re: [R] Lattice, stripplot (xyplot), plotting data with median line, numeric x-axis

2009-09-27 Thread Felix Andrews
Hi David, stripplot is for numeric vs categorical data (and is a thin wrapper around xyplot). Just change stripplot to xyplot and it will work. -Felix 2009/9/27 Afshartous, David : > All, > > On p.52 of Deepayan Sarkar's Lattice book there is a nice plot of showing > residuals with median line

Re: [R] QQ plotting of various distributions...

2009-09-27 Thread Eric Thompson
The supposed example of a Q-Q plot is most certainly not how to make a Q-Q plot. I don't even know where to start First off, the two "Q:s in the title of the plot stand for "quantile", not "random". The "answer" supplied simply plots two sorted samples of a distribution against each other. Whi

Re: [R] Fw: Re: Multiple Normal Curves

2009-09-27 Thread KABELI MEFANE
Hi Jim   Sorry to bother you but i don't seem to understand what you are saying. I have the simulated data as follows:   Hypermarket <- matrix(rnorm(100, mean=5, sd=5000)) Supermarket <- matrix(rnorm(400, mean=34000, sd=3000)) Minimarket  <- matrix(rnorm(1000, mean=1,sd=2000)) Cornershop 

Re: [R] multiple lattice, xyplot & levelplot on same page

2009-09-27 Thread Felix Andrews
Ky, The error you report is a problem with the c() method for trellis plots: it allows for a different panel function in each panel, but only one prepanel function. Because of this, the prepanel.default.levelplot function is not getting what it expects to recompute the panel dimensions. It may be

[R] Select.spatial on spplots

2009-09-27 Thread Julius Tesoro
Hi everyone. I posted this on R-sig-geo but got no response. Can select.spatial() be used in an existing spplot? I have tried selecting points (eq) from a plot generated from sp. However, when I invoke select.spatial(eq). It generates only the points without the background containing the fau

Re: [R] for cycle with uncontinuous numbers

2009-09-27 Thread Tobias Verbeke
Hi nice people, :-) I would like to do a for cycle but i wish it to assume only the numers 50, 100, 200, 300, 900 and 2343 I tried to do something like x <- c(50,100,200,300,900,2343) for (i in x){ #. } But it didn´t work If you would use a reproducible code example we could point out

Re: [R] Teach me how to transpose in R

2009-09-27 Thread Marcio Resende
Hi Hyo, I am kinda of new in R but I think if you use x <- as.matrix(data2) #with the numer of collumns you wish y <- t(x) it should work Hope I´ve helped Márcio Hyo Lee wrote: > > Hi guys, > I need your help!! > > My goal is to make a csv file from ncdf file. > This is the code i've used

[R] need help in mixed poisson regression

2009-09-27 Thread hossain zamani
Dear all,  I have a mixed Poisson regression model . my function is: ## P(N=k)=[(a+2)/a ][(lambda^k)]*[((a+2/a+1)+lambda)^(-k-1)-(a+2+lambda)^(-k-1)]; lambda=a0+a1*x1+a2*x2 This is same as a Poisson-inverse gaussian or Poisson-lognormal regression.I want to estimate the parameters by fitting th

[R] for cycle with uncontinuous numbers

2009-09-27 Thread Marcio Resende
Hi nice people, I would like to do a for cycle but i wish it to assume only the numers 50, 100, 200, 300, 900 and 2343 I tried to do something like x <- c(50,100,200,300,900,2343) for (i in x){ #. } But it didn´t work Could anybody help me? Thanks in advance Marcio -- View this message in c

Re: [R] QQ plotting of various distributions...

2009-09-27 Thread Petar Milin
Thanks for the answer. Now, only problem is to to get parameter(s) of a given function. For gamma, I shall try with gammafit() from mhsmm package. Also, I shall look for others appropriate parameter estimates. Will use SuppDists too. Best, PM Sunil Suchindran wrote: #same shape some_data <-

Re: [R] Teach me how to transpose in R

2009-09-27 Thread cls59
Hyo Lee wrote: > > > Teach me how to deal with this problem. > Thank you very much. > > -Hyo > > A good thing to try if you're stuck finding the right function in R is searching with ??. For example, if you type: ??"transpose" The base routine t(), which performs a matrix transpose, is