Re: [R] how can I plot the histogram like this using R?

2010-04-14 Thread Tal Galili
Aer you asking how to have more bars on the axis ? That can be controlled using: barplot(stuff, br = 50) # br can be other numbers according to needs. The vertical line can be done with: abline(v=20) # You may change 20 There are other elements to the plot to reproduce, but is this enough for

[R] maptools-export owin as shapefile, error message

2010-04-14 Thread Tom Elliott
Hello R users, I am trying to export an object of class owin from the Spatstat package to an ESRI shapefile using the package Maptools. I am using the function writePolyShape; pointsp is an object of class ppp, ripras is a function in SpatStat that creates a polygon around points. I have tried

Re: [R] WinBUGS Question

2010-04-14 Thread Uwe Ligges
Or even easier: Use BRugs which has a considerably cleaner interface and does not need to restart the WinBUGS executable again and again. Uwe Ligges On 13.04.2010 22:45, Yihui Xie wrote: If you are using R2WinBUGS, I guess you may put them in a loop like: # models ... data_i[j]~dnorm(...)

[R] Problem trying to plot Vennerable object

2010-04-14 Thread Chris Cole
Hi, I'm new to the list so apologies if this has been asked before. I couldn't find any refs in google. I recently installed the Vennerable library from Rforge, this required an upgrade of R to 2.10.0 by the 'pylr' dependency. However, a very simple command fails: Vcomb - Venn(SetNames=

[R] Problem with recode -Error in parse(text = range[[1]][1]) : unexpected end of input in c(0

2010-04-14 Thread Simon Kiss
Dear colleagues, in the help archive there was a previous person who encountered a problem with the recode command in the car library. I'm not sure if that was solved, there was no posting to that effect, but I'm having the same problem. I'm trying to recode a numeric variable with values

Re: [R] creating a new corClass for lme()

2010-04-14 Thread Viechtbauer Wolfgang (STAT)
No idea if this helps, but if the optimizer (nlminb) is giving you problems, you could try switching to another optimizer (nlm) with: control=list(opt=nlm) Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and StatisticsTel: +31 (43)

[R] GAMM : how to use a smoother for some levels of a variable, and a linear effect for other levels?

2010-04-14 Thread JANSEN, Ivy
Hi, I was reading the book on Mixed Effects Models and Extensions in Ecology with R by Zuur et al. In Section 6.2, an example is discussed where a gamm-model is fitted, with a smoother for time, which differs for each value of ID (4 different bird species). In earlier versions of R, the

[R] sum specific rows in a data frame

2010-04-14 Thread arnaud Gaboury
I have a data frame called pose: DESCRIPTION QUANITY CLOSING.PRICE 1 WHEAT May/101467.75 2 WHEAT May/102467.75 3 WHEAT May/101467.75 4 WHEAT May/101467.75 5 COTTON NO.2 May/101 78.13

[R] Bayesian bootstrap with boot

2010-04-14 Thread hhafner
Hi, I wonder about whether it is possible to perform a Bayesian bootstrap using the boot package. The documentation isn't very detailed and I don't have the associated book. So I would be glad, if someone could help me. If it isn't possible: Which package / which function can I use instead?

Re: [R] sum specific rows in a data frame

2010-04-14 Thread Mohamed Lajnef
Hi Arnaud, Try aggregate function regards M arnaud Gaboury a écrit : I have a data frame called pose: DESCRIPTION QUANITY CLOSING.PRICE 1 WHEAT May/101467.75 2 WHEAT May/102467.75 3 WHEAT May/101467.75 4

Re: [R] Problem with recode -Error in parse(text = range[[1]][1]) : unexpected end of input in c(0

2010-04-14 Thread Peter Ehlers
Get rid of the unnecessary c(...) construction: recode(green_2004_2$french, 50:100=0; 0:49.99=1) -Peter Ehlers On 2010-04-14 1:56, Simon Kiss wrote: Dear colleagues, in the help archive there was a previous person who encountered a problem with the recode command in the car library. I'm not

Re: [R] Problem trying to plot Vennerable object

2010-04-14 Thread Peter Ehlers
On 2010-04-14 1:54, Chris Cole wrote: Hi, I'm new to the list so apologies if this has been asked before. I couldn't find any refs in google. I recently installed the Vennerable library from Rforge, this required an upgrade of R to 2.10.0 by the 'pylr' dependency. However, a very simple

[R] MiscPsycho - incorrect levenshtein distance?

2010-04-14 Thread Ben Meijering
For some strings I get a wrong (MiscPsycho) Levenstein distance: stringMatch(abc, ab, normalize=NO) [1] 1 stringMatch(abc, bc, normalize=NO) [1] 2 I think the lines d - matrix(0, nrow = n + 1, ncol = m + 1) d[, 1] - 1:(n + 1) d[1, ] - 1:(m + 1) d[1, 1] - 0 should be changed to d -

[R] R package documentation

2010-04-14 Thread Sébastien Bihorel
Dear R users, I am currently writing the documentation for my first package. I have created a short user manual using sweave/pdflatex which is distinct from the manual/summary-of-package-functions created by R CMD CHECK. I was wondering how could I seamlessly combine both documents. Thanks for

Re: [R] Error: could not find function tsts tradesys package

2010-04-14 Thread Sarah Goslee
Did you load tradesys after you installed it? library(tradesys) That seems to be a common beginner problem. Sarah On Tue, Apr 13, 2010 at 9:56 PM, dbonneau daronnebonn...@gmail.com wrote: Hi, I am pretty new to R and would like to follow the code in the paper below, tradesys package. but I

Re: [R] R package documentation

2010-04-14 Thread Tobias Verbeke
Hi Sébastien, Sébastien Bihorel wrote: I am currently writing the documentation for my first package. I have created a short user manual using sweave/pdflatex which is distinct from the manual/summary-of-package-functions created by R CMD CHECK. I was wondering how could I seamlessly combine

Re: [R] R package documentation

2010-04-14 Thread Sébastien Bihorel
Hi Tobias, The .R files that I have created for all my functions are somehow used to generate a package manual pdf when I used R CMD CHECK. This is what I'd like to add in my vignette. It might be uncommon, but I saw this was done for several package documentations (e.g. PBS collections) and I

Re: [R] how can I plot the histogram like this using R?

2010-04-14 Thread bbslover
thanks for your help. I can have a try. -- View this message in context: http://n4.nabble.com/how-can-I-plot-the-histogram-like-this-using-R-tp1839303p1839534.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] Problems getting symbols() to show table data

2010-04-14 Thread Guy Green
Hello, I am trying to create a graphic to help me visualise data. A (very simplified) sample of the data is http://n4.nabble.com/file/n1839676/circle_data.txt circle_data.txt : Aug-07 Nov-07 Feb-08 data1 1 1.5 -1 data2 1

Re: [R] how can I plot the histogram like this using R?

2010-04-14 Thread bbslover
thank you, I will try this function barplot. -- View this message in context: http://n4.nabble.com/how-can-I-plot-the-histogram-like-this-using-R-tp1839303p1839541.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] Running cumulative sums in matrices

2010-04-14 Thread Eleni Rapsomaniki
Dear R-helpers, I have a huge data-set so need to avoid for loops as much as possible. Can someone think how I can compute the result in the following example (that uses a for-loop) using some version of apply instead (or any other similarly super-efficient function)? example: #Suppose a

Re: [R] R package documentation

2010-04-14 Thread Tobias Verbeke
Hi Sébastien, Sébastien Bihorel wrote: The .R files that I have created for all my functions are somehow used to generate a package manual pdf when I used R CMD CHECK. This is what I'd like to add in my vignette. It might be uncommon, but I saw this was done for several package

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread Dennis Murphy
Hi: Is this what you want? m1=cbind(1:5,1:5,1:5) apply(m1, 1, cumsum) [,1] [,2] [,3] [,4] [,5] [1,]12345 [2,]2468 10 [3,]369 12 15 HTH, Dennis On Wed, Apr 14, 2010 at 5:18 AM, Eleni Rapsomaniki er...@medschl.cam.ac.ukwrote: Dear

Re: [R] Problem with recode -Error in parse(text = range[[1]][1]) : unexpected end of input in c(0

2010-04-14 Thread John Fox
Dear Simon, The problem is that the recode specification is incorrect: In recode(), colons mean ranges, and shouldn't appear within c(), which is used to list values. See ?recode, and the following example: (green_2004_2 - data.frame(french=runif(10, 0, 100))) french 1 42.693517 2

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread ONKELINX, Thierry
?cumsum can help you m1 - cbind(1:5,1:5,1:5) m2 - m1 for(i in 2:ncol(m1)){ m2[,i]=apply(m1[,1:i],1,sum) } m3 - t(apply(m1, 1, cumsum)) all.equal(m2, m3) HTH, Thierry ir. Thierry Onkelinx Instituut voor

Re: [R] how can I plot the histogram like this using R?

2010-04-14 Thread Tal Galili
Hi, My bid - do all that I wrote with hist instead of barplot Best, Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |

Re: [R] can not execute two functions - env() and profile()

2010-04-14 Thread pnouvellet
Hi, I had the same problem on windows with same R version... With the package lme4a (from R-forge), I can use the env() function. However, I am still unable to use the profile function (in the aim of establishing confidence interval for the std devaition of random effect). any help will be

Re: [R] Problem with recode -Error in parse(text = range[[1]][1]) : unexpected end of input in c(0

2010-04-14 Thread David Winsemius
On Apr 14, 2010, at 2:56 AM, Simon Kiss wrote: Dear colleagues, in the help archive there was a previous person who encountered a problem with the recode command in the car library. I'm not sure if that was solved, there was no posting to that effect, but I'm having the same problem.

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread Dimitris Rizopoulos
you can even use a simple for-loop, e.g., m1 - cbind(1:5,1:5,1:5) out - m1 for(i in 1:nrow(out)) out[i, ] - cumsum(out[i, ]) which seems to be faster than apply(m1, 1, cumsum), i.e., m1 - m1[rep(1:5, each = 1e04), ] library(rbenchmark) benchmark( apply = apply(m1, 1, cumsum), for

Re: [R] Problems getting symbols() to show table data

2010-04-14 Thread Gabor Grothendieck
Try this: library(gplots) m - matrix(c(1, 2, -3, -6, 5, 4), 3) tm - t(m) balloonplot(row(tm), col(tm), abs(tm), dotcolor = c(blue, red)[(c(tm) 0) + 1], show.margins = FALSE, cum.margins = FALSE, xlab = Cols, ylab = Rows, main = m) On Wed, Apr 14, 2010 at 7:58 AM, Guy Green

Re: [R] MiscPsycho - incorrect levenshtein distance?

2010-04-14 Thread David Winsemius
Generally bug reports should go the the package emaintainer. On Apr 14, 2010, at 5:08 AM, Ben Meijering wrote: For some strings I get a wrong (MiscPsycho) Levenstein distance: I see you spelled it correctly in your subject line. stringMatch(abc, ab, normalize=NO) [1] 1 stringMatch(abc,

Re: [R] R package documentation

2010-04-14 Thread Sébastien Bihorel
Thanks Tobias, If there is no automated way to combine both documents, I will stack them manually... that will likely cause some problems with page numbering tough. Sebastien On Wed, Apr 14, 2010 at 8:18 AM, Tobias Verbeke tobias.verb...@openanalytics.eu wrote: Hi Sébastien, Sébastien

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread Eleni Rapsomaniki
That's really interesting... I have always assumed that for-loops take longer than apply. Perhaps it depends on the application. I'll try both in my code and see. Thank you! Eleni Rapsomaniki Research Associate Tel: +44 (0) 1223 740273 Strangeways Research Laboratory Department of Public

Re: [R] env() for lme4

2010-04-14 Thread pnouvellet
Hi, using lme4a, and the dystuff data, I call profile and get: profile(fm1ML) Error in UseMethod(profile) : no applicable method for 'profile' applied to an object of class lmer any solutions? -- View this message in context: http://n4.nabble.com/env-for-lme4-tp1565045p1839791.html Sent

[R] Third and fourth order of derivative in smooth.lf function from locfit package

2010-04-14 Thread FMH
Dear All, Could someone please advice me the way to define the derivative of the local polynomial regression in third and fourth order from the smooth.lf function? Thank you Fir [[alternative HTML version deleted]] __

Re: [R] Problem with recode -Error in parse(text = range[[1]][1]) : unexpected end of input in c(0

2010-04-14 Thread John Fox
Dear David, Thank you for addressing this question, but I answered Simon's question in an email I sent to the R help list a while ago: You can't mix : and c() in a recode specification; : isn't the sequence operator in a recode specification but rather represents a continuous range of values.

Re: [R] MiscPsycho - incorrect levenshtein distance?

2010-04-14 Thread Doran, Harold
Thanks for pointing this out, it is indeed a bug. I have a few things on my plate today but will try and revise and place a new version on CRAN soon. -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Wednesday, April 14, 2010 9:06 AM To: Ben Meijering Cc: r

Re: [R] import file formatted RFC-822

2010-04-14 Thread Sebastian Kruk
Barry, thank you so much! It's work. __ 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,

[R] total. factor. prodctvty. help!!

2010-04-14 Thread serdal
Dear all, I have a basic(!) econometric question which i couldnt find the way to do it in R. Well this could be also because of my wrong interpretation of the econometric process that i am trying to implemet.so here i wanna ask if am doing a logical mistake!!! so here is the question with the

Re: [R] svm of e1071 package

2010-04-14 Thread Steve Lianoglou
Hi Shyama, On Tue, Apr 13, 2010 at 10:40 AM, Shyamasree Saha [shs] s...@aber.ac.uk wrote: Dear Steve, We have finally managed to run our code. Sparse matrix is helping a lot (I should say without matrix.csr, we would not be able to do it). This time it is taking very small amount of memory

Re: [R] env() for lme4

2010-04-14 Thread Rob Goedman
Pierre, This question is better asked on R-sig-ME. I updated below call to 'profile(fm...@env)' Regards, Rob On Apr 14, 2010, at 6:28 AM, pnouvellet wrote: Hi, using lme4a, and the dystuff data, I call profile and get: profile(fm1ML) Error in UseMethod(profile) : no applicable

[R] how to delete columns with NA values?

2010-04-14 Thread muting
Hi everyone: I have a dataset: tm1 col1 col2 [1,]1 NA [2,]11 [3,]22 [4,]11 [5,]22 [6,]1 NA I need to delete entire column 2 that has NA in it(not all of them are NAs), and the result I want is tm1 col1 [1,]1 [2,]1 [3,]2

Re: [R] how to delete columns with NA values?

2010-04-14 Thread Erik Iverson
Hello, muting wrote: Hi everyone: I have a dataset: This looks like a matrix. To perform functions on each row or column of a matrix, use the apply function. If you had a data.frame, you could perform a function on each column using sapply or lapply. tm1 col1 col2 [1,]1 NA

Re: [R] how to delete columns with NA values?

2010-04-14 Thread Chuck Cleland
On 4/14/2010 10:56 AM, muting wrote: Hi everyone: I have a dataset: tm1 col1 col2 [1,]1 NA [2,]11 [3,]22 [4,]11 [5,]22 [6,]1 NA I need to delete entire column 2 that has NA in it(not all of them are NAs), and the result I want is

[R] Roxygen - basic usage uncertain

2010-04-14 Thread David Esp
I am trying to make a package consisting of a single function with auto-documentation assistance from 'roxygen' but am uncertain of the correct procedure. My version of 'R' is 2.10.1. I followed the following steps: 1) Get an existing function (un-commented) as an '.R' file. 2) Add formal

Re: [R] R package documentation

2010-04-14 Thread Sharpie
pomchip wrote: Dear R users, I am currently writing the documentation for my first package. I have created a short user manual using sweave/pdflatex which is distinct from the manual/summary-of-package-functions created by R CMD CHECK. I was wondering how could I seamlessly combine

[R] fitting a quadratic function - poly?

2010-04-14 Thread Stefan Uhmann
Hi List, I can not get my head around the following problem. I want to fit a quadratic function to some data and stumbled across poly(). What exactly does it, i.e. why are there different results for fit1 and fit2? x = seq(-10, 10) y = x^2 fit1 = lm(y ~ x + I(x^2)) fit2 = lm(y ~ poly(x, 2))

Re: [R] how to delete columns with NA values?

2010-04-14 Thread muting
Thank you all! It works well now -- View this message in context: http://n4.nabble.com/how-to-delete-columns-with-NA-values-tp1839902p1839953.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] how to delete columns with NA values?

2010-04-14 Thread Stefan Uhmann
Hi muting, # your data muting - data.frame(col1 = c(1,1,2,1,2,1), col2=c(NA,1,2,1,2,NA)) # 1. finding rows with NA is.na(muting) # 2. counting the NAs per column colSums(is.na(muting)) # 3. keeping only the ones without NAs muting[,colSums(is.na(muting)) == 0] Regards, Stefan schrieb muting,

Re: [R] fitting a quadratic function - poly?

2010-04-14 Thread Duncan Murdoch
On 14/04/2010 11:12 AM, Stefan Uhmann wrote: Hi List, I can not get my head around the following problem. I want to fit a quadratic function to some data and stumbled across poly(). What exactly does it, i.e. why are there different results for fit1 and fit2? x = seq(-10, 10) y = x^2 fit1

Re: [R] sum specific rows in a data frame

2010-04-14 Thread arnaud Gaboury
Thank you for your help. The best I have found is to use the ddply function. pose DESCRIPTION QUANITY CLOSING.PRICE 1 WHEAT May/101467.75 2 WHEAT May/101467.75 3 WHEAT May/101467.75 4 WHEAT May/101

Re: [R] Network Analysis

2010-04-14 Thread bchaney
Does anyone have any thoughts on this? I would really appreciate any insights/suggestions that the group could provide. -- View this message in context: http://n4.nabble.com/Network-Analysis-tp1838902p1839992.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread Bert Gunter
Eleni et. al.: Perhaps it's worth noting that there is generally NO reason to prefer apply-family code to explicit for-loops for execution speed. Apply-type statments **are** essentially disguised loops -- that is, they execute the loop code repeatedly at the R interpreter level. They do employ

Re: [R] - how/when/why do you use it?

2010-04-14 Thread Greg Snow
The - assignment operator is very powerful, but can be dangerous as well. When tempted to use it, look for alternatives first, there may be a better way. But having said that, I am one of the more guilty people for using it (quite a few of the functions in the TeachingDemos package use -).

[R] Odp: fitting a quadratic function - poly?

2010-04-14 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 14.04.2010 17:12:51: Hi List, I can not get my head around the following problem. I want to fit a quadratic function to some data and stumbled across poly(). What exactly does it, i.e. why are there different results for fit1 and fit2? x =

Re: [R] Odp: fitting a quadratic function - poly?

2010-04-14 Thread Bert Gunter
Below. -- Bert Bert Gunter Genentech Nonclinical Statistics Coefficients are different as you fit different values. See ?poly poly(-10:10,2) I believe that others give you better explanation. So you can not use coefficients evaluated by lm(.~poly(...)) directly. -- Well, it depends what

Re: [R] Odp: fitting a quadratic function - poly?

2010-04-14 Thread Petr PIKAL
Hi Bert Gunter gunter.ber...@gene.com napsal dne 14.04.2010 18:01:52: Below. -- Bert Bert Gunter Genentech Nonclinical Statistics Coefficients are different as you fit different values. See ?poly poly(-10:10,2) I believe that others give you better explanation. So you

Re: [R] - how/when/why do you use it?

2010-04-14 Thread Szumiloski, John
I love Patrick Burns' comment on the - operator in R Inferno: If you think you need '-', think again. If on reflection you still think you need '-', think again. Is this in package::fortunes? John John Szumiloski, Ph.D. Senior Biometrician Biometrics Research WP53B-120 Merck Research

[R] array manipulation

2010-04-14 Thread Muhammad Rahiz
Hello listeRs, I'm trying to make a square radius around a given reference point. So given the following array, how can I manipulate it so that x0 - array(1,dim=c(5,5)) x0 1 1 1 1 1 1 1 1 1 1 1 1 *1* 1 1 1 1 1 1 1 1 1 1 1 1 becomes into 3 3 3 3 3 3 2 2 2 3 3 2 *1* 2 3 3 2 2 2 3 3 3 3 3 3

Re: [R] memory failure in adonis function (permanova)

2010-04-14 Thread Gavin Simpson
On Tue, 2010-03-16 at 17:12 +0100, Paloma Ruiz wrote: Dear all, I am trying to get a PERMANOVA with quite large data set. I am reading a lot about this question, but I do not get the answer about it. Although I know that the R function is adonis () (vegan package), it does not work:

Re: [R] Gaussian Quadrature Numerical Integration In R

2010-04-14 Thread Ravi Varadhan
Just do a variable transformation. If your function is f(x), your new function would be: f'(x) = sigma * f(sigma * x + mu). You can integrate f'(x) using the Hermite quadrature. Ravi. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On

Re: [R] Odp: fitting a quadratic function - poly?

2010-04-14 Thread Bert Gunter
Petr Pikal wrote: ... I mean that you can use fit- lm(y~x+I(x^2)) coef(fit)[1] + coef(fit)[2]*x + coef(fit)[3]*x^2 but you can not use fit- lm(y~poly(x,2)) coef(fit)[1] + coef(fit)[2]*x + coef(fit)[3]*x^2 (to get the fits for any x vector) -- But you **can** use ypred -

Re: [R] Import ASCII data using a .sas program

2010-04-14 Thread Donald Catanzaro, PhD
Good Day, I have several ASCII data files that I would like to import into R. They all have a SAS import file which is used to bring the data into SAS and I am hoping to use this to bring the data into R. There are lots of variables involved and the ASCII data file is 2308 columns long so I

Re: [R] Simulation problem.

2010-04-14 Thread Greg Snow
This looks like homework. If it is, you should really tell us along with what your teacher's policy is on getting help over the internet is (and note that many teachers monitor this list and can see if you are getting help). You have done the first part yourself, much better than some who have

Re: [R] array manipulation

2010-04-14 Thread Bert Gunter
1+pmax(abs(row(z)-3),abs(col(z)-3)) ?row ?col ?pmax for details. Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Muhammad Rahiz Sent: Wednesday, April 14, 2010 9:44 AM To:

Re: [R] - how/when/why do you use it?

2010-04-14 Thread jim holtman
If you use '-' remember that you are going to get into trouble and it will be a challange to debug your script. Only use it if you have a real good understanding of the scoping rules in R and have exhausted all the other avenues. I, like Greg, am guilty of using it because I still keep some of

[R] what is the intercept of a two-way anova model without interaction term?

2010-04-14 Thread Xiaokuan Wei
Dear list, I have a question regarding the meaning of intercept term in a two-way anova model without interaction term. for example (let's assume there is no interaction between factor1 and factor2) : df         val        factor1 factor2 1  48.61533       A      t1

Re: [R] Network Analysis

2010-04-14 Thread Jakson A. Aquino
On Wed, Apr 14, 2010 at 07:44:23AM -0800, bchaney wrote: Does anyone have any thoughts on this? I would really appreciate any insights/suggestions that the group could provide. I did not do sophisticated analyzes, but my opinion is that igraph is easier to use and more versatile than statnet.

Re: [R] how can I plot the histogram like this using R?

2010-04-14 Thread Greg Snow
There are several ways in which the picture you show is uglier than the histogram produced by R. Which of these do you want to accomplish and why? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message-

Re: [R] Getting Started with Bayesian MCMC

2010-04-14 Thread Greg Snow
The purpose of the task view is to answer questions like this. I for one would not be able to give a better answer than what is there. My suggestion would be to pull out your Bayesian textbook (or get one, or use online notes from a class, etc.) and look through the homework problems and

Re: [R] import file formatted RFC-822

2010-04-14 Thread Sebastian Kruk
I have a problem, In a few cases robot-exclusion-useragent have 2 or more values, is there a manner to fix it? For example, robot askjeeves has three names. 2010/4/13 Barry Rowlingson b.rowling...@lancaster.ac.uk: On Tue, Apr 13, 2010 at 6:26 PM, Sebastian Kruk residuo.so...@gmail.com wrote:

Re: [R] import file formatted RFC-822

2010-04-14 Thread Barry Rowlingson
On Wed, Apr 14, 2010 at 6:20 PM, Sebastian Kruk residuo.so...@gmail.com wrote: I have a problem, In a few cases robot-exclusion-useragent have 2 or more values, is there a manner to fix it? For example, robot askjeeves has three names. use 'all=TRUE'? test data: foo: 1 bar: 2 foo: 1 foo: 2

Re: [R] - how/when/why do you use it?

2010-04-14 Thread Gabor Grothendieck
x - will usually wind up assigning into the parent or global environment but since it depends on what is already there the following are safer: e - environment() parent.env(e)$x - 1 globalenv()$x - 2 Typically in cases like this the function that contains the assignment can be regarded as a

Re: [R] - how/when/why do you use it?

2010-04-14 Thread Steve Lianoglou
If you think you need '-', think again.  If on reflection you still think you need '-', think again. Is this in package::fortunes? +1 for adding that to fortunes ... I remember reading through The R Inferno and getting a good laugh from several such one liners ... -steve -- Steve Lianoglou

Re: [R] Factor variables with GAM models

2010-04-14 Thread Gavin Simpson
On Fri, 2010-03-19 at 20:37 -0700, Steven McKinney wrote: Hi Noah GAM models were developed to assess the functional form of the relationship of continuous predictor variables to the response, so weren't really meant to handle factor variables as predictor variables. GAMs are of the form

[R] ur.df ADF Unit Root Test: what is the meaning of phi1 and phi2 test statistic?

2010-04-14 Thread Maximilian Rausch
Hello, I am using the ur.df function from the {arca} package to run the augmented Dickey-Fuller unit root test on several time series. However; I do not understand the econometric interpretation of the the phi1 and phi2 test-statisitc which are output if you choose a trend or drift model. I

[R] Sig differences in Loglinear Models for Three-Way Tables

2010-04-14 Thread Sachi Ito
Hi all, I've been running loglinear models for three-way tables: one of the variables having three levels, and the other two having two levels each. An example looks like below: yes.no - c(Yes,No) switch - c(On,Off) att - c(BB,AA,CC) L - gl(2,1,12,yes.no) T - gl(2,2,12,switch) A -

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread Greg Snow
Does this do what you want? m1 - cbind(1:5,1:5,1:5) m2 - m1 for(i in 2:ncol(m1)){ m2[,i] - apply(m1[,1:i],1,sum) } m2 ut - diag( ncol(m1) ) ut[upper.tri(ut)] - 1 m3 - m1 %*% ut m3 all.equal(m2,m3) hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

Re: [R] NMDS Ordination Graphics Problem

2010-04-14 Thread Gavin Simpson
On Mon, 2010-04-05 at 09:58 -0800, Trey wrote: Dr. Stevens, Hmm, did you get the wrong address there ;-) As Michael Denslow has mentioned, the way to handle this sort of customised plotting at the moment in vegan is to build the plot up by hand. Michael's response earlier showed you how to do

Re: [R] vegan (ordisurf): R² for smoothed surf aces

2010-04-14 Thread Gavin Simpson
On Tue, 2010-04-13 at 15:02 +0200, Kim Vanselow wrote: Dear r-helpers, I just read in an article by Virtanen et al. (2006) where vegetation-environment relationships are studied by fitting smoothed surfaces on an NMDS ordination using GAMs (Wood 2000). The authors describe, that they used R²

Re: [R] GAMM : how to use a smoother for some levels of a variable, and a linear effect for other levels?

2010-04-14 Thread Gavin Simpson
On Wed, 2010-04-14 at 10:03 +0200, JANSEN, Ivy wrote: Hi, I was reading the book on Mixed Effects Models and Extensions in Ecology with R by Zuur et al. In Section 6.2, an example is discussed where a gamm-model is fitted, with a smoother for time, which differs for each value of ID (4

Re: [R] what is the intercept of a two-way anova model without interaction term?

2010-04-14 Thread Dennis Murphy
Hi: Perhaps this will clarify some things: model.matrix(m) (Intercept) factor1B factor1C factor2t2 factor2t3 1 100 0 0 2 110 0 0 3 101 0 0 4 10

Re: [R] Import ASCII data using a .sas program

2010-04-14 Thread John Fox
Dear Don, What read.fwf() needs are the field widths. I think that the following will do what you want: strings - scan(what=) 1: perstat1 $1-2 3: linenum $3-4 5: I_wave1 $5-5 7: bnocost1 $6-10 9: bnosta1 $11-12 11: Read 10 items (fields -

Re: [R] Error: could not find function tsts tradesys package

2010-04-14 Thread dbonneau
Thank you so much for your reply. On the first page of the paper, there are logics which I typed library(tradesys) library(TTR) data(spx) tail(spx) ,and it runs smoothly. But it gives me an error at x - tsts(spx) Thanks, db -- View this message in context:

Re: [R] svm of e1071 package

2010-04-14 Thread Shyamasree Saha [shs]
Hello Steve, Thanks for your reply. yes, i converted input matrix to a sparse matrix (via SparseMatrix). rbind is fine for our case as anyway we have to do it. So, instead of using rbind on dense matrix and convert the whole matrix at the end, we take convert each chunk and add it to the big

[R] Selecting derivative order penalty for thin plate spline regression (GAM - mgcv)

2010-04-14 Thread Christos Argyropoulos
Hi, I am using GAMs (package mgcv) to smooth event rates in a penalized regression setting and I was wondering if/how one can select the order of the derivative penalty. For my particular problem the order of the penalty (parameter m inside the s terms of the formula argument) appears

[R] how to draw multiple vertical bands

2010-04-14 Thread senne
hi R gurus I saw some graphs with vertical band like this one: http://pragcap.com/wp-content/uploads/2010/04/GS.png how to draw the blue band in R, can't find any clue to do this,any ideas? thanks in advance [[alternative HTML version deleted]]

[R] envelope in spatstat

2010-04-14 Thread T.O. Richardson
Hi R users, This query is regarding the use of the 'envelope' function in Spatstat. My data can be represented as a point process with CONTINUOUS marks: points - ppp(x=x,y=y, marks=m, window= wind) However the marks are alignments (lines), and so have to be treated differently to normal

[R] Conflict plot.circular and layout() using different column width of the layout matrix

2010-04-14 Thread Daniela Buesser
Hi I am trying to make a figure with several subfigure using the layout(). The subfigures include circular plots (package:circular). When I use different widths of the columns (layout(matrix(1:6, 2,3), width=c(1,1.5,1))) the circular plots in the first row have an elliptic and unpredictible

Re: [R] Error: could not find function tsts tradesys package

2010-04-14 Thread Erik Iverson
You need to take this up with the package authors. After I install tradesys, and type vignette(tradesys), I get a PDF that no longer contains the example in the PDF you reference from the web. That particular version of the PDF that you reference is probably no longer relevant to the

Re: [R] Error: could not find function tsts tradesys package

2010-04-14 Thread Peter Ehlers
I think that this package is very much in the early stages of development. It may be that the tsts function is still just a gleam in the eyes of the developers. The paper that you cite may be ahead of code development. -Peter Ehlers On 2010-04-14 10:20, dbonneau wrote: Thank you so much for

Re: [R] Error: could not find function tsts tradesys package

2010-04-14 Thread Erik Iverson
Peter Ehlers wrote: I think that this package is very much in the early stages of development. It may be that the tsts function is still just a gleam in the eyes of the developers. The paper that you cite may be ahead of code development. Yes, in my reply I assumed behind, but 'ahead' is

[R] curve

2010-04-14 Thread Dwayne Blind
Dear R users, How can I use curve with a function of two variables ? Thank you very much, Dwayne [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] liner regression for multiple keys

2010-04-14 Thread Ben Bolker
newbie_2010 girishbogu at gmail.com writes: a1 is the first key in input. second column is x-axis and 3rd is y-axis and 4th is its corresponding key. Now for every key in 1st column I would like to calculate LR that gives p value. I tried to manage with a single key. But my problem is that

Re: [R] curve

2010-04-14 Thread Ben Bolker
Dwayne Blind dwayneblind at gmail.com writes: How can I use curve with a function of two variables ? see curve3d in the emdbook package. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Sig differences in Loglinear Models for Three-Way Tables

2010-04-14 Thread Charles C. Berry
See comments in line. On Wed, 14 Apr 2010, Sachi Ito wrote: Hi all, I've been running loglinear models for three-way tables: one of the variables having three levels, and the other two having two levels each. An example looks like below: yes.no - c(Yes,No) switch - c(On,Off) att -

Re: [R] R package documentation

2010-04-14 Thread David Scott
Sébastien Bihorel wrote: Thanks Tobias, If there is no automated way to combine both documents, I will stack them manually... that will likely cause some problems with page numbering tough. Sebastien There was a thread a while back (this year) about someone who wanted to incorporate his

Re: [R] Ranking correlation with R

2010-04-14 Thread David Nemer
Hello Guys, thank you all very much for the help! Sorry for my total lack of knowledge in R... so I did the correlation.. and got these results: cor(A, C, method = spearman) [1] 0.4922165 cor(B, C, method = spearman) [1] 0.1922412 cor(A, B, method = spearman) [1] -0.00889328 I don't know

Re: [R] how to draw multiple vertical bands

2010-04-14 Thread jim holtman
?rect On Wed, Apr 14, 2010 at 10:36 AM, senne wase...@gmail.com wrote: hi R gurus I saw some graphs with vertical band like this one: http://pragcap.com/wp-content/uploads/2010/04/GS.png how to draw the blue band in R, can't find any clue to do this,any ideas? thanks in advance

Re: [R] filled.contour ON TOP of a base map

2010-04-14 Thread Víctor Homar Santaner
Anyone? [[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://www.R-project.org/posting-guide.html and provide commented, minimal,

  1   2   >