Re: [R] Conditional looping over a set of variables in R

2010-10-24 Thread David Herzberg
Adrienne - this solves the problem nicely. Thanks for your help. David S. Herzberg, Ph.D. Vice President, Research and Development Western Psychological Services 12031 Wilshire Blvd. Los Angeles, CA 90025-1251 Phone: (310)478-2061 x144 FAX: (310)478-7838 email: dav...@wpspublish.com From:

Re: [R] Long model formulae

2010-10-24 Thread Bill.Venables
Here is a dodge I often use. This is a mock-up example. ___ bar - data.frame(matrix(rnorm(1001), nrow = 1)) names(bar)[1] - y ## say head(bar[,1:5]) nbar - names(bar) form - as.formula(paste(nbar[1], ~, paste(nbar[-1], collapse = +))) fitModel - substitute(tm - rpart(FORM, data =

Re: [R] Feedback on you manual

2010-10-24 Thread Patrick Burns
Okay, I've been convinced of both the feasibility and the desirability of a pdf. However, such a thing is unlikely to appear very soon. On 23/10/2010 20:23, 刘力平 wrote: Hi, all: My opinion is, provide a PDF tutorial is important, but not one web page containing everything. From the

Re: [R] Feedback on you manual

2010-10-24 Thread Patrick Burns
On 24/10/2010 04:35, Steve Lianoglou wrote: [ ... ] Speaking as as an older R-user to a new R-user, I can understand some of the frustrations you feel with coming up to speed with a new programming language. One piece of advice I have for you is that you should actually take the time to read

[R] gamma glm - using of weights gives error

2010-10-24 Thread Andreas Wittmann
Dear R-users, i try to use the following code to do a gamma regression glm(x1 / x2 ~ x3 + x4 + x5 + x6 + x7 + x8, family=Gamma(link=log), weights=x2) but here i get the error Error: NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: step size truncated due to

Re: [R] Feedback on you manual

2010-10-24 Thread Liviu Andronic
On Sun, Oct 24, 2010 at 10:33 AM, Patrick Burns pbu...@pburns.seanet.com wrote: If you look at 'Introduction' through the eyes of a complete novice, it is really, really scary. Ditto. I had no programming background prior to learning R, and after half a minute glancing through the 'Intro to R'

Re: [R] Bayesian constrained regression method?

2010-10-24 Thread Michael Bedward
Hello Jim, Please reply to the list - you'll have a much better chance of getting useful suggestions. OK so some addition info. I know each of the X2 is in (0,1). Is there any method available? I don't think that's sufficient to estimate b, at least not in my experience of fitting Bayesian

[R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Lorenzo Isella
Dear All, I would like to plot a scalar (e.g. a temperature) on a non-rectangular domain (or even better: I would simply like to be able to draw a contour plot on an arbitrary 2D domain). I wonder if there is any tool to achieve that with R. I did some online search in particular on the list

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Ted Harding
On 24-Oct-10 11:30:57, Lorenzo Isella wrote: Dear All, I would like to plot a scalar (e.g. a temperature) on a non-rectangular domain (or even better: I would simply like to be able to draw a contour plot on an arbitrary 2D domain). I wonder if there is any tool to achieve that with R. I did

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Lorenzo Isella
On 10/24/2010 01:51 PM, (Ted Harding) wrote: On 24-Oct-10 11:30:57, Lorenzo Isella wrote: Dear All, I would like to plot a scalar (e.g. a temperature) on a non-rectangular domain (or even better: I would simply like to be able to draw a contour plot on an arbitrary 2D domain). I wonder if there

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Uwe Ligges
On 24.10.2010 14:14, Lorenzo Isella wrote: On 10/24/2010 01:51 PM, (Ted Harding) wrote: On 24-Oct-10 11:30:57, Lorenzo Isella wrote: Dear All, I would like to plot a scalar (e.g. a temperature) on a non-rectangular domain (or even better: I would simply like to be able to draw a contour plot

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread David Winsemius
On Oct 24, 2010, at 4:30 AM, Lorenzo Isella wrote: Dear All, I would like to plot a scalar (e.g. a temperature) on a non- rectangular domain (or even better: I would simply like to be able to draw a contour plot on an arbitrary 2D domain). I wonder if there is any tool to achieve that

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Lorenzo Isella
On 10/24/2010 02:55 PM, David Winsemius wrote: On Oct 24, 2010, at 4:30 AM, Lorenzo Isella wrote: Dear All, I would like to plot a scalar (e.g. a temperature) on a non-rectangular domain (or even better: I would simply like to be able to draw a contour plot on an arbitrary 2D domain). I

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread David Winsemius
On Oct 24, 2010, at 6:12 AM, Lorenzo Isella wrote: As to the domain of the function, at least in case (1), that should arise from the collected data points in (x,y) if the sampling is dense enough. And that is precisely what you get from the perimeter function. The earlier Design

Re: [R] Long model formulae

2010-10-24 Thread James Hirschorn
Here is a dodge I often use. This is a mock-up example. Very instructive (and helpful) ... ___ bar - data.frame(matrix(rnorm(1001), nrow = 1)) names(bar)[1] - y ## say head(bar[,1:5]) nbar - names(bar) form - as.formula(paste(nbar[1], ~, paste(nbar[-1], collapse = +)))

[R] Turning ppp into im in spatstat

2010-10-24 Thread Sebastian Schutte
Dear all, I'm working with two point patterns (ppp) in spatstat. I turned one of them into a spatial covariate (im) object. After that, I used this im object to fit a Poisson model for the second point pattern, using the covariate layer from the first one. In R, the whole thing looks somewhat

Re: [R] Random Forest AUC

2010-10-24 Thread Liaw, Andy
The OOB error estimates in RF is one really nifty feature that alleviate the need for additional cross-validation or resampling. I've done some empirical comparison between OOB estimates and 10-fold CV estimates, and they are basically the same. Andy -Original Message- From:

Re: [R] Conditional looping over a set of variables in R

2010-10-24 Thread Peter Ehlers
This won't be as quick as Bill's elegant solution, but it's a one-liner: apply(d, 1, function(x), match(1, x)) See ?match. -Peter Ehlers On 2010-10-22 10:36, David Herzberg wrote: Bill, thanks so much for this. I'll get a chance to test it later today, and will post the outcome. David

[R] best predictive model for mixed catagorical/continuous variables

2010-10-24 Thread jamessc
Would anybody be able to advise on which package would offer the best approach for producing a model able to predict the probability of species occupation based upon a range of variables, some of them catagorical (eg. ten soil types where the numbers assigned are not related to any

[R] covariance matrix

2010-10-24 Thread Marcelo Lima
Hi all, I generated a covariance matrix and visualized as a 2D contour plot (x,y, covariance matrix), I would like to extract from the matrix the values ( in x and y) that auto-correlate which I will plot as an normal (x,y(being the values that auto-corelate to a certain x and y values in my

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Lorenzo Isella
Hi, And thanks for helping. I am anyway a bit puzzled, since case (1) is not only a matter of interpolation. Probably the point I did not make clear (my fault) is that case (1) in my original email does not refer to an irregular grid on a rectangular domain; the set of (x,y) coordinate could

[R] cvs fpr R

2010-10-24 Thread Alaios
Hello everyone. These days I am writing some code for a small project. I have started having problems with different versions of the files I keep (in case I need to move to older files). I need some easy cvs platform ( I do not know if cvs is the general name or a specific program) that is easy

Re: [R] preferred x-delimited data format for R?

2010-10-24 Thread Liviu Andronic
On Wed, Oct 20, 2010 at 5:30 PM, Nutter, Benjamin nutt...@ccf.org wrote: I run into that problem frequently. I can usually circumvent it by using the  quote = \ Argument.  The default is quote = \'  which uses the double and single quote as quoting symbols.  If you change it to \ it will read

[R] Subsetting a dataframe

2010-10-24 Thread ANJAN PURKAYASTHA
Hi, I have a dataframe with 43 columns and a 1000 rows. Each entry in the dataframe can be either P or A. here is a small chunk: c1c2 ...c43 r100 P A ... P r101 A A ... A r102 P P ... P How does one subset this data frame to select those rows

Re: [R] Subsetting a dataframe

2010-10-24 Thread Jorge Ivan Velez
Hi Anjan, Please consider the following example: x - c(2, rep(1, 10)) all(x == 1) [1] FALSE d - replicate(10, sample(x, replace = TRUE)) d [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,]111111211 1 [2,]111212

Re: [R] cvs fpr R

2010-10-24 Thread Steve Lianoglou
Hi, On Sun, Oct 24, 2010 at 1:15 PM, Alaios ala...@yahoo.com wrote: Hello everyone. These days I am writing some code for a small project. I have started having problems with different versions of the files I keep (in case I need to move to older files). I need some easy cvs platform ( I

Re: [R] Subsetting a dataframe

2010-10-24 Thread ANJAN PURKAYASTHA
Thanks all for your help. Anjan On Sun, Oct 24, 2010 at 1:38 PM, Jorge Ivan Velez jorgeivanve...@gmail.comwrote: Hi Anjan, Please consider the following example: x - c(2, rep(1, 10)) all(x == 1) [1] FALSE d - replicate(10, sample(x, replace = TRUE)) d [,1] [,2] [,3] [,4]

Re: [R] Conditional looping over a set of variables in R

2010-10-24 Thread Peter Ehlers
Whoops, got an extra comma in there somehow; should be: apply(d, 1, function(x) match(1, x)) -Peter Ehlers On 2010-10-24 08:17, Peter Ehlers wrote: This won't be as quick as Bill's elegant solution, but it's a one-liner: apply(d, 1, function(x), match(1, x)) See ?match. -Peter

[R] more errors (behavior)

2010-10-24 Thread ivo welch
quick programming question. I am not making enough errors in my programs, so I want to trigger a few more. ;-) [1] undefined variable behavior: d=data.frame( x=rnorm(1:10), y=rnorm(1:10)) z Error: object 'z' not found d$z NULL is this consistent? I thought that z is the same as

Re: [R] more errors (behavior)

2010-10-24 Thread Ted Harding
On 24-Oct-10 19:55:12, ivo welch wrote: quick programming question. I am not making enough errors in my programs, so I want to trigger a few more. ;-) [1] undefined variable behavior: d=data.frame( x=rnorm(1:10), y=rnorm(1:10)) z Error: object 'z' not found d$z NULL is this

[R] call for paper-nov/dec 2010

2010-10-24 Thread Editor Chief
Dear Sir/Madam *CALL FOR PAPER – DECEMBER ISSUE* Greetings from INTERNATIONAL JOURNAL OF COMPUTER TECHNOLOGY AND APPLICATIONS (IJCTA) IJCTA is an international, peer-reviewed online journal entitled to publish original research articles in the fields of Computer science and Information

[R] 140 packages in R Commander!!

2010-10-24 Thread Ajay Ohri
Dear List I just downloaded and installed R 2.12.0 and then installed R Commander . First it got RCmdr and Car, and then suggested for other packages for utilizing the full functionality- I clicked yes! I got 140 packages installed!!! Cran Mirror was UCLA... Here is the list. Is this

[R] How to simulate from an estimated density

2010-10-24 Thread wangguojie2006
Hi, dear fellows, I was wondering how can I simulate from an estimated density function? I used my training data set and already have estimated density values at some fixed points. I plan to simulate some data from such estimated density and compare them to my validation data set. Anyone can

[R] Importing CSV File

2010-10-24 Thread Jason Kwok
I'm trying to import a CSV file into R and when it gets imported, the entries get numbered down the left side. How do I get rid of that? Thanks, Jason * read.csv(file=C:\\Program Files\\R\\Test Data\\sales.csv,head=TRUE) Month Sales 1January 422 2 February 151 3 March

Re: [R] Importing CSV File

2010-10-24 Thread Erik Iverson
On 10/24/2010 04:57 PM, Jason Kwok wrote: I'm trying to import a CSV file into R and when it gets imported, the entries get numbered down the left side. How do I get rid of that? When you imported the CSV file into R, an object of class data.frame was created, and since you did not assign it

Re: [R] Importing CSV File

2010-10-24 Thread Jason Kwok
Thanks for the response Erik. In this case, I would like to keep the row name as the month. How would I do that? Thanks, Jason On Sun, Oct 24, 2010 at 6:20 PM, Erik Iverson er...@ccbr.umn.edu wrote: On 10/24/2010 04:57 PM, Jason Kwok wrote: I'm trying to import a CSV file into R and when

Re: [R] How to simulate from an estimated density

2010-10-24 Thread sachinthaka . abeywardana
You usually simulate a distribution by: 1. building the cumulative distribution (use cumsum). 2. Simulating a random number (from uniform distribution, use runif (number_of_simulations_needed)). 3. Get the closest number to the number simulated from the cumulative distribution. 4. The

Re: [R] Importing CSV File

2010-10-24 Thread Bill.Venables
sales - read.csv(file=C:/Program Files/R/Test Data/sales.csv, header=TRUE, row.names = Month) ^^^ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of

Re: [R] Importing CSV File

2010-10-24 Thread Liviu Andronic
On Mon, Oct 25, 2010 at 12:26 AM, Jason Kwok jayk...@gmail.com wrote: Thanks for the response Erik. In this case, I would like to keep the row name as the month.  How would I do that? You can do this in Rcmdr. First Data Import From text file (or select your data.frame as active data set),

Re: [R] Conditional looping over a set of variables in R

2010-10-24 Thread Gabor Grothendieck
On Sun, Oct 24, 2010 at 2:54 PM, Peter Ehlers ehl...@ucalgary.ca wrote: Whoops, got an extra comma in there somehow; should be:  apply(d, 1, function(x) match(1, x)) A slight variation on this would be: apply(d, 1, match, x = 1) -- Statistics Software Consulting GKX Group, GKX

Re: [R] 140 packages in R Commander!!

2010-10-24 Thread John Fox
Dear Ajay, This is a consequence of installing the dependencies (including suggested packages, etc.) of the Rcmdr package, their dependencies, and so on recursively. The alternative would be for the Rcmdr package to specify its direct dependencies via depends rather than suggests, but then these

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread David Winsemius
On Oct 24, 2010, at 9:30 AM, Lorenzo Isella wrote: Hi, And thanks for helping. I am anyway a bit puzzled, since case (1) is not only a matter of interpolation. Probably the point I did not make clear (my fault) is that case (1) in my original email does not refer to an irregular grid

Re: [R] Help: Maximum likelihood estimation

2010-10-24 Thread Ravi Varadhan
Can you provide a reproducible code? Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu

[R] Unable to allocate arrays of size 2GB in 64 bit Windows 7 R

2010-10-24 Thread Bhattacharyya, Siddhartha
I seem Unable to allocate arrays of size around 2GB in 64 bit Windows 7 R. There is a lot of main memory available. The memory.limit is set to the max memory available, and there is more than 10GB of that available when R returns an 'unable to allocate memory' error. Is this a limitation of R

[R] re-vertical conversion of data entries

2010-10-24 Thread Penny Adversario
Dear R user, Can you please help me. How do I convert part of a cluster analysis output under the heading “Clustering vector” as shown below, showing the clusters to which each respondent belongs to:      [1] 1 1 2 2 1 2 1 2 1 1 2 2 1 2 2 2 2 1 1 1 1 2 2 1 2 2 1 2 2 2 2 2 2 2 2 1 2  

[R] Question on passing the subset argument to an lm wrapper

2010-10-24 Thread Erik Iverson
Hello, How would you go about handling the following situation? This is on R 2.12.0 on Ubuntu 32-bit. I have a wrapper function to lm. I want to pass in a subset argument. First, I just thought I'd use ## make example reproducible set.seed(123) df1 - data.frame(age = rnorm(100, 50, 10),

[R] R-Fortran question (multiple subroutines)

2010-10-24 Thread Remko Duursma
Dear R-helpers, apologies if this is somewhere in a manual, I have not been able to find anything relevant. I run Windows Vista. I have some Fortran code in a subroutine, and have no problem calling this from R with .Fortran, compiling the code either with 'R CMD SHLIB' or independently with

[R] Text wrapping in R

2010-10-24 Thread Johannes Huesing
I am about to give an introduction to R to some clinical data managers used to SAS. There is already a lot of material in printed form and on the web that paves the way. What I haven't found so far are text wrapping capabilities in setting tables in raw text as in SAS PROC REPORT. At the moment

Re: [R] Text wrapping in R

2010-10-24 Thread Uwe Ziegenhagen
2010/10/25 Johannes Huesing johan...@huesing.name I am about to give an introduction to R to some clinical data managers used to SAS. There is already a lot of material in printed form and on the web that paves the way. What I haven't found so far are text wrapping capabilities in setting

Re: [R] Text wrapping in R

2010-10-24 Thread Jeffrey Spies
I would demonstrate one of the many LaTeX table functions. Off hand, packages xtable, hmisc, and quantreg all have functions that convert R objects to LaTeX tables. If they're unwilling to work in LaTeX, you can use something like LaTeXiT or Laeqed to create PDFs or PNGs of the tables for