Re: [R] input a list into a function

2009-12-25 Thread Don MacQueen
It works for me, without changes. See below. But I can recreate your error if I type the plus signs at the beginning of second and third lines. For your example, don't type any plus signs, except for the one in print(g[i]+x)} By the way, nothing that you did fits the description "input a l

Re: [R] input a list into a function

2009-12-25 Thread Patrick Connolly
On Fri, 25-Dec-2009 at 05:27PM -0800, Cat Morning wrote: |> ? |> I want to input a list into a function. But i get the error "Error in +{ : invalid argument to unary operator". How do I avoid this error? |> ? |> Here is an example of this problem: |> ? |> > g = c(2, 4, 8, 16, 32, 64, 128, 122,

[R] input a list into a function

2009-12-25 Thread Cat Morning
  I want to input a list into a function. But i get the error "Error in +{ : invalid argument to unary operator". How do I avoid this error?   Here is an example of this problem:   > g = c(2, 4, 8, 16, 32, 64, 128, 122, 110, 86, 38, 76, 18, 36, 72, 10, 20, 40, > 80, 26) > for (i in 1:20)  + {f

Re: [R] Running 32 bit R in terminal on Mac OS

2009-12-25 Thread Sharpie
saleem1000 wrote: > > Hello, > > I am using Mac OS on R. When I start R thru the application menu I have > the option of running both the 32 bit version as well as the 64 bit > version. > > When I type in R in terminal I believe it starts up the 64 bit version. > How can I start the 32 bit ve

[R] Composing a sequence of functions dynammically

2009-12-25 Thread Saptarshi Guha
Hello, I would like to compose a series of functions each taking one argument. Let us assume the values returned by the functions are contained within the domains. So b<-function(r) r[-1] compose("b","b") b(b(x)) This is my solution, is there something succinct ? Regards Saptarshi compose <- fu

Re: [R] How to separate a data set by its factors

2009-12-25 Thread David Winsemius
On Dec 25, 2009, at 2:00 PM, David Winsemius wrote: On Dec 25, 2009, at 9:38 AM, James Rome wrote: Thanks for the help. I tried making the pdf file as suggested. Acrobat said it was damaged and could not be opened. Is this an R bug? Hard to say. Graphics devices vary from OS to OS and I a

[R] [R-pkgs] sqldf 0.2-0

2009-12-25 Thread Gabor Grothendieck
A new version of sqldf, version 0.2-0, has been uploaded to CRAN and should be available on most mirrors by now. NEW - works with the new version of DBI package, DBI 0.2-5. The default action of this version of DBI quotes those column names in select statements that are SQL reserved words (rath

Re: [R] How to separate a data set by its factors

2009-12-25 Thread David Winsemius
On Dec 25, 2009, at 9:38 AM, James Rome wrote: Thanks for the help. I tried making the pdf file as suggested. Acrobat said it was damaged and could not be opened. Is this an R bug? Hard to say. Graphics devices vary from OS to OS and I am on a Mac using a 64 bit bit version of R 2.10.1. I

Re: [R] Multiple CHOLMOD errors when attempting poisson glmm

2009-12-25 Thread Douglas Bates
On Thu, Dec 24, 2009 at 1:03 PM, postava-davig.m wrote: > > Hello, > I have been attempting to run a poisson glmm using lme4 for some time now > and have had a lot of trouble.  I would say 9 times out of 10 I receive the > following warning: > CHOLMOD warning:  %h > Error in mer_finalize(ans) :

[R] [ how can sample from f(x)~x^(a-1)

2009-12-25 Thread khazaei
Hello all how can sample from f(x)~x^(a-1)*ind(0,min(b,-log(u)) in R? where a and b is positive constand and 0https://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, reproducible code

[R] how can sample from f(x)∝x^(a-1)

2009-12-25 Thread khazaei
Hello all how can sample from f(x)∝x^(a-1)*ind(0,min(b,-log(u)) in R? where a and b is positive constand and 0https://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, reproducible code

Re: [R] Help with SVM package Kernlab

2009-12-25 Thread David Winsemius
On Dec 25, 2009, at 1:18 AM, Vishal Thapar wrote: > Hi David, > > Thanks for your reply. The package is Kernlab. No, the package name is "kernlab". Case of characters matters in R, as the rest of your problems also illustrate as well. > I agree with you when you mention that R didn't like the

Re: [R] How to separate a data set by its factors

2009-12-25 Thread James Rome
Thanks for the help. I tried making the pdf file as suggested. Acrobat said it was damaged and could not be opened. Is this an R bug? It did make a PostScript file that I was able to distill into PDF, but it was gray scales. How do I get the color back? And yes, I did do the layout I wanted so I c

Re: [R] How to dbReadTable() only a limited number of rows? (RMySQL)

2009-12-25 Thread Orvalho Augusto
Try this >drv <- dbDriver("MySQL") >con(drv, etc parameters...) > dbGetQuery(con, "select * from tableyoulike limit N_integer_first_records") Hope it helps Caveman On Fri, Dec 25, 2009 at 12:10 AM, Peng Yu wrote: > I only want to load a limited number of rows by dbReadTable(). I don't > see an

Re: [R] Help with SVM package Kernlab

2009-12-25 Thread Vishal Thapar
Hi, I seem to have made some headway on this problem but its still not solved. It seems like this is a "factor" issue. When I read my training set, I read it with read.csv() which converts each of the columns as "factors". From this if I take a single row as my testSeq, it works great. On the othe

[R] boot() with an array-valued statistic?

2009-12-25 Thread Stephan Kolassa
Dear guRus, is there a version of boot() that deals with array data and array-valued statistics? For example: foo <- array(rnorm(120),dim=c(3,5,8)) means <- apply(foo, MARGIN=c(2,3), FUN=mean) means contains the means over the first dimension of foo: a 5x8 array. Now I would like to bootstra

Re: [R] help in merging

2009-12-25 Thread Gabor Grothendieck
Not sure if its guaranteed but this sqlite join does seem to preserve the order of the first data frame. > library(sqldf) > BOD Time demand 118.3 22 10.3 33 19.0 44 16.0 55 15.6 67 19.8 > BODrev <- BOD[6:1,]; BODrev Time demand 67 19.8 55 15.6

Re: [R] aggregate binary response data

2009-12-25 Thread Daniel Malter
?tapply - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Graham Leask Sent: Thursday, December 24, 2009 7:57 AM To: r-help@r-project.org Subject: [R] aggre