[R] Parallel stem-and-leaf displays

2008-09-11 Thread Celia Chen
Hi there, I am trying to find a way to accomplish parallel stem-and-leaf displays in R, yet there seems to be no specific command nor info in the archive that I can depend on. Specifically, there are two batches of data that I want to put together in parallel stem-and-leaf displays. Would anyone

Re: [R] Save object summary to file

2008-09-11 Thread Yihui Xie
Hi, The returned value of summary.princomp() is NOT a data.frame and cannot be coerced into a data.frame (it's a list), so you cannot write it into a file using write.table(). I guess what you really intend to write is: # x <- summa

Re: [R] Creating data frame from existing data frame

2008-09-11 Thread Peter Alspach
Josh You are wanting to subset the data so try help(subset) or ?subset. And follow the See also which refers to '['. You might also find the introductory manual helpful. Most of the contributed documentation on CRAN (the comprehensive R archive network) will cover this with examples. I found Pa

Re: [R] Problemas con JRI

2008-09-11 Thread milton ruser
pseudo-Transation: Hi, my name is Angel, and I am making an Java´s application that use some fuctions available on R. I am sorry for this, but I can´t bypass the intallation step of JRI´s package. I will be very happy if someone help on this task. I read the JRI´s documents that is absent (no ava

[R] Save object summary to file

2008-09-11 Thread pgseye
Hi, Am wanting to save the summary of a PCA to file. Have tried: > write.table(summary(PCA), file="PCAvar.txt", sep="\t") but receive: Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class "summary.princomp" into a data.frame Wh

Re: [R] making spearman correlation cor() call fail with log(0) as input

2008-09-11 Thread Timur Shtatland
You are right, Inf and -Inf are not considered errors in R, they are accepted as input to Spearman's cor(), and so I will have to check the input myself for such condition. Thank you for pointing this out! Timur On Wed, Sep 10, 2008 at 8:50 PM, Greg Snow <[EMAIL PROTECTED]> wrote: > Your code sho

[R] Creating data frame from existing data frame

2008-09-11 Thread 2k3autococker
I'm new to R, using it for an engineering stats class, and the first project is focused on creating data frames and plotting graphs. So far I have imported a set of data from a text file and saved it as a variable (using the read.table() function). One of the columns of the data consists of years,

[R] subsetting of factor

2008-09-11 Thread Hui-Yi Chu
Dear R list, I think my question maybe easy for you but I really spent entire day to resolve it. Say I have a matrix, rows are 6000 genes, columns(1-6) are 3 genotypes (a,b,c) with 2 repeat. I have to use two groups each time for t-test, a vs. c or b vs. c, but I dont know how to write correct cod

Re: [R] Problemas con JRI

2008-09-11 Thread Dr Eberhard W Lisse
Kann man das vielleicht mal auf Englisch fragen? mfg, el On 11 Sep 2008, at 23:42 , Ángel Orosa Rodríguez wrote: Hola, me llamo Ángel y estoy haciendo una aplicación en Java que usa funciones ya implementadas en R, siento molestarte para esta tontería, pero es que ya ni paso de la instalació

Re: [R] database table merging tips with R

2008-09-11 Thread Thomas Lumley
On Thu, 11 Sep 2008, Coey Minear wrote: Actually, based on my reading of the DBI reference, you should be able to do the following to create a table (although possibly not temporary): dbWriteTable(connection, "r_user_ids", r) Then you can use the following to drop the table: dbRemoveTable(c

Re: [R] Complex sampling survey _ Use of survey package

2008-09-11 Thread Thomas Lumley
On Thu, 11 Sep 2008, Ahoussou Sylvie wrote: Data base = tab1 here are the five first rows of the database (nrow = 11792) num esp Quarters Totcat Totshp Totgt Tbtpos fpc1 Totanim Id_An 10 2045 G 01-Q1 0 0 12 1 551

Re: [R] How to obtain a sequence of dates consisting of only weekdays

2008-09-11 Thread Weiyang Lim
This was precisely what I was looking for. I did not realize that chron package allows for this. Thank you very much, Gabor. Many thanks also to Yihui for his kind assistance. Best Regards, Weiyang -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: 11 September

Re: [R] Newbie: 'table' output in columns rather than matrix

2008-09-11 Thread Marc Schwartz
on 09/11/2008 09:34 PM Matthew Pettis wrote: > Hi, > > Coming to R from SAS... Welcome! > I have a data.frame A with 2 long factors "x" and "y". I want to get > a count of the number of rows with each level of "x" and "y" jointly. > 'table' seemed like it would work, but as I have many levels,

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread Gabor Grothendieck
On Thu, Sep 11, 2008 at 10:43 PM, hadley wickham <[EMAIL PROTECTED]> wrote: >> The problem is trying to force everything into Date class. If you really >> want a monthly series you probably want yearmon rather than Date >> class > > Could you give a bit more detail about why you think this is the

Re: [R] Newbie: 'table' output in columns rather than matrix

2008-09-11 Thread Rolf Turner
On 12/09/2008, at 2:34 PM, Matthew Pettis wrote: Hi, Coming to R from SAS... I have a data.frame A with 2 long factors "x" and "y". I want to get a count of the number of rows with each level of "x" and "y" jointly. 'table' seemed like it would work, but as I have many levels, the matrix out

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread hadley wickham
> The problem is trying to force everything into Date class. If you really > want a monthly series you probably want yearmon rather than Date > class Could you give a bit more detail about why you think this is the best way to proceed? To me, it seems like it's easiest to have one date class whi

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread Gabor Grothendieck
On Thu, Sep 11, 2008 at 10:22 PM, hadley wickham <[EMAIL PROTECTED]> wrote: >>> I don't think that cut.Date helps because I want to make a new series, >>> not divide up an existing one, similarly with to.period. as.yearmon, >> >> Use cut.Date like this (assuming the dates variable as in your post)

[R] Newbie: 'table' output in columns rather than matrix

2008-09-11 Thread Matthew Pettis
Hi, Coming to R from SAS... I have a data.frame A with 2 long factors "x" and "y". I want to get a count of the number of rows with each level of "x" and "y" jointly. 'table' seemed like it would work, but as I have many levels, the matrix output is pretty useless to me (and I don't care about z

Re: [R] help: error handling in try

2008-09-11 Thread Andy Zhu
Hi, Jim: Thanks again for replying. Sorry to confuse on saying stop the program; I mean program exits the function early where stop raises the error (this is inside a function). It seems that try doesn't fit in a function (in my old version) but tryCatch does (don't use stop in a function to ra

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread hadley wickham
>> I don't think that cut.Date helps because I want to make a new series, >> not divide up an existing one, similarly with to.period. as.yearmon, > > Use cut.Date like this (assuming the dates variable as in your post): > > r <- as.Date(cut(range(dates), "month")) > > > # every month > seq(r[1], r

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread Gabor Grothendieck
On Thu, Sep 11, 2008 at 5:42 PM, hadley wickham <[EMAIL PROTECTED]> wrote: > On Thu, Sep 11, 2008 at 11:00 AM, Gabor Grothendieck > <[EMAIL PROTECTED]> wrote: >> See ?cut.Date >> >> In the zoo package see: >> ?as.yearmon >> ?as.yearqtr >> ?aggregate.zoo >> >> and the many examples in: >> ?plot.zoo

Re: [R] How to load functions in R

2008-09-11 Thread Henrik Bengtsson
Wow... source() on a text file is the way to go - forget everything else. If you have multiple *.R script files, in a directory, say R/, you can load them all by: pathnames <- list.files(pattern="[.]R$", path="R/", full.names=TRUE); sapply(pathnames, FUN=source); or even shorter: sapply(list.f

Re: [R] plot of all.effects object

2008-09-11 Thread John Fox
Dear David, > -Original Message- > From: David Afshartous [mailto:[EMAIL PROTECTED] > Sent: September-11-08 4:48 PM > To: John Fox > Cc: r-help@r-project.org > Subject: Re: [R] plot of all.effects object > > > Dear John, > > Thanks and sorry for the typo. > > For the example below, how

Re: [R] database table merging tips with R

2008-09-11 Thread Moshe Olshansky
Just a small correction: start with s <- paste(r$userid,collapse=",") and not s <- paste(r$userid,sep=",") --- On Fri, 12/9/08, Moshe Olshansky <[EMAIL PROTECTED]> wrote: > From: Moshe Olshansky <[EMAIL PROTECTED]> > Subject: Re: [R] database table merging tips with R > To: [EMAIL PROTECTED

[R] Doubt with the intallation of JRI

2008-09-11 Thread Ángel Orosa Rodríguez
Hi, my name is Angel, i'm doing a program in Java which calls R in order to do some operations. Well, I don't know how can I instal JRI; first, it's said that I need a program named MinGW and I have downloaded it and tried to install it; here all is ok, but when i tried to execute the program, it d

Re: [R] database table merging tips with R

2008-09-11 Thread Moshe Olshansky
One possibility is as follows: If r$userid is your array of (2000) ID's then s <- paste(r$userid,sep=",") s<- paste("select t.userid, x, y, z from largetable t where t.serid in (",s,")",sep="") and finally d <- sqlQuery(connection,s) Regards, Moshe. --- On Fri, 12/9/08, Avram Aelony <[EMAIL P

Re: [R] About "Plot.new"

2008-09-11 Thread Marc Schwartz
on 09/11/2008 05:41 PM cathelf wrote: > Hi, sorry for bothering your guys. > I will trying to make some nice graph using boxplot. when I check the help > file of boxplot, there is a sample code as: > > boxplot(len ~ dose, data = ToothGrowth, add = TRUE, > boxwex = 0.25, at = 1:3 + 0

Re: [R] About "Plot.new"

2008-09-11 Thread Adam D. I. Kramer
You can't add=TRUE unless the graph exists in the first place. So, drop that if you're creating the graph. Or if that's there because you want to put a boxplot on top of a preexisting graph, make sure you have created the preexisting graph already. --Adam On Thu, 11 Sep 2008, cathelf wrote: H

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread hadley wickham
> Hadley, > > What's wrong with: > > dates <- structure(c(8516, 8544, 8568, 8596, 8609, 8666, 8701, 8750, > 8754, 8798, 8811, 8817, 8860, 8873, 8918, 8931, > 8966, 9020, 9034, 9056), class = "Date") > > The problem is this: > as.Date(cut.Date(dates, "day"))

[R] About "Plot.new"

2008-09-11 Thread cathelf
Hi, sorry for bothering your guys. I will trying to make some nice graph using boxplot. when I check the help file of boxplot, there is a sample code as: boxplot(len ~ dose, data = ToothGrowth, add = TRUE, boxwex = 0.25, at = 1:3 + 0.2, subset = supp == "OJ", col = "or

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread Marc Schwartz
on 09/11/2008 04:42 PM hadley wickham wrote: > On Thu, Sep 11, 2008 at 11:00 AM, Gabor Grothendieck > <[EMAIL PROTECTED]> wrote: >> See ?cut.Date >> >> In the zoo package see: >> ?as.yearmon >> ?as.yearqtr >> ?aggregate.zoo >> >> and the many examples in: >> ?plot.zoo >> ?xyplot.zoo >> as well as t

[R] Problemas con JRI

2008-09-11 Thread Ángel Orosa Rodríguez
Hola, me llamo Ángel y estoy haciendo una aplicación en Java que usa funciones ya implementadas en R, siento molestarte para esta tontería, pero es que ya ni paso de la instalación del JRI. A ver si me puedes ayudar, te lo agradecería muchísimo!! A ver, yo leí en la página de JRI que hacen falta l

[R] Complex sampling survey _ Use of survey package

2008-09-11 Thread Ahoussou Sylvie
Hello everybody I don't understand how I'm supposed to use svydesign caracteristics to explain to R that my sampling design is the following one Data base = tab1 here are the five first rows of the database (nrow = 11792) num esp Quarters Totcat Totshp

Re: [R] database table merging tips with R

2008-09-11 Thread Avram Aelony
At some point I'd like to try to compile the DBI-based ROracle package as well. For now though, I'll stick with RODBC as it seems to do what I need. I believe RODBC is not based on DBI, but that shouldn't preclude using the pre-built subquery option which is a great idea and should work regar

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread hadley wickham
On Thu, Sep 11, 2008 at 2:26 PM, Jeffrey J. Hallman <[EMAIL PROTECTED]> wrote: > Look at the ti (Time Index) class in package tis. Here's some examples I > just did: >> x <- Sys.Date() >> x > [1] "2008-09-11" >> ti(x, "wsaturday") ## a ti for the week that x falls into > [1] 20080913 > clas

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread hadley wickham
On Thu, Sep 11, 2008 at 11:00 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > See ?cut.Date > > In the zoo package see: > ?as.yearmon > ?as.yearqtr > ?aggregate.zoo > > and the many examples in: > ?plot.zoo > ?xyplot.zoo > as well as the three zoo vignettes. > > Also in the xts package look at

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread hadley wickham
On Thu, Sep 11, 2008 at 12:04 PM, Whit Armstrong <[EMAIL PROTECTED]> wrote: > probably not pre-canned routines for that, but very easy to implement > with the tools provided in the library. > > Looks like most of what you want to do is fairly simple and not worth > the trouble of involving c++. > >

Re: [R] database table merging tips with R

2008-09-11 Thread Coey Minear
Avram Aelony writes: > > I have not devoted time to setting up ROracle since binaries are > not available and it seems to require some effort to compile (see > http://cran.r-project.org/web/packages/ROracle/index.html). On the > other hand, RODBC worked more or less magically once I set up t

Re: [R] plot of all.effects object

2008-09-11 Thread David Afshartous
Dear John, Thanks and sorry for the typo. For the example below, how do I get the time.num variable to correspond to the x-axis? I tried refitting the model with a different order of supplied variables but this didn't do it. Cheers, David On 9/11/08 4:28 PM, "John Fox" <[EMAIL PROTECTED]>

Re: [R] plot of all.effects object

2008-09-11 Thread John Fox
Dear David, You have to spell the name of term correctly: plot(fm.effects, "time.num:drug:X") (Admittedly, the error message is cryptic: I'll look into that.) A couple of other comments: (1) There is only one high-order term in your model, so it's not necessary to use all.effects(); (2) if you

Re: [R] How to load functions in R

2008-09-11 Thread Rolf Turner
On 12/09/2008, at 2:53 AM, <[EMAIL PROTECTED]> wrote: Hello, It seems that all methods work. Source() however loads only the last function. This is absolute nonsense. You are doing something wrong and/or not understanding what you are doing. This is bad practice.

Re: [R] Difference in p-values between R and SPSS

2008-09-11 Thread Thomas Lumley
That is a larger difference in p-values than I would expect due to numerical differences and stopping criteria. My guess is that you are running across the different approximations for tied failure times. If so, you will get better agreement with SPSS by using method="breslow" in coxph().

Re: [R] database table merging tips with R

2008-09-11 Thread Avram Aelony
I have not devoted time to setting up ROracle since binaries are not available and it seems to require some effort to compile (see http://cran.r-project.org/web/packages/ROracle/index.html). On the other hand, RODBC worked more or less magically once I set up the data sources. What is your su

[R] plot of all.effects object

2008-09-11 Thread David Afshartous
All, I'm trying to plot an all.effects() object, as shown in the help for all.effects and also Crawley's R book (p.178, 2007). The data has a repeated measures structure, but I'm using all.effects for the simple lm() fit here. Below is a reproducible example that yields the error message. fm.

Re: [R] database table merging tips with R

2008-09-11 Thread Coey Minear
While the subquery with a temporary table is probably the better option, you could just manually generate the subquery and pass it in with the query. As an example, if you have user_ids 1000-1005, instead of having "... where user_id in (select user_id from r_user_id)", you would have "... where u

Re: [R] Plot qnorm

2008-09-11 Thread G. Jay Kerns
Dear Talina, On Thu, Sep 11, 2008 at 2:28 PM, Talina Ruiz <[EMAIL PROTECTED]> wrote: > Hi, > > I have this problem: > > X is hazardous variable N(mean 2, sd=3) > >>>question 1) Find the c value, so that P(X>c)=0.10. using R > >>>question 2) Graph the function N(2,3) and with this graph, explain wh

Re: [R] database table merging tips with R

2008-09-11 Thread Coey Minear
Aaron Mackey writes: > I guess I'd do it something like this: > > dbGetQuery(con, "CREATE TEMPORARY TABLE foo ( etc etc)") > sapply(@userids, function (x) { dbGetQuery(con, paste("INSERT INTO foo > (userid) VALUES (", x, ")")) }) > > then later: > > dbGetQuery(con, "DROP TABLE foo"); >

Re: [R] boxplot

2008-09-11 Thread John Kane
Perhaps your data does not have whiskers? x <- c(4,5,6,4,5,6,4,5,6,4,5,6) boxplot(x) # No whiskers boxplot(1:10) # whiskers --- On Thu, 9/11/08, Daniela Garavaglia <[EMAIL PROTECTED]> wrote: > From: Daniela Garavaglia <[EMAIL PROTECTED]> > Subject: [R] boxplot > To: r-help@r-project.org > Re

Re: [R] database table merging tips with R

2008-09-11 Thread Aaron Mackey
I guess I'd do it something like this: dbGetQuery(con, "CREATE TEMPORARY TABLE foo ( etc etc)") sapply(@userids, function (x) { dbGetQuery(con, paste("INSERT INTO foo (userid) VALUES (", x, ")")) }) then later: dbGetQuery(con, "DROP TABLE foo"); -Aaron On Thu, Sep 11, 2008 at 3:21 PM, Avram Ae

Re: [R] Calculate mean/var by ID

2008-09-11 Thread Adaikalavan Ramasamy
A slight variation of what Jorge has proposed is: f <- function(x) c( mu=mean(x), var=var(x) ) do.call( "rbind", tapply( df$value, df$ID, f ) ) mu var 111 4.33 4.33 138 6.00 4.67 178 5.00 8.00 Regards, Adai Jorge Ivan Velez wrote: Dear J

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread Jeffrey J. Hallman
Look at the ti (Time Index) class in package tis. Here's some examples I just did: > x <- Sys.Date() > x [1] "2008-09-11" > ti(x, "wsaturday") ## a ti for the week that x falls into [1] 20080913 class: ti > ti(x + 1, "wsaturday") - 1 ## ti for the latest complete week [1] 20080906 class:

Re: [R] database table merging tips with R

2008-09-11 Thread Avram Aelony
Perhaps I will need to create a temp table, but I am asking if there is a way to avoid it. It would be great if there were a way to tie the R data frame temporarily to the query in a transparent fashion. If not, I will see if I can create/drop the temp table directly from sqlQuery. -Avram

Re: [R] How to load functions in R

2008-09-11 Thread Adam D. I. Kramer
Source(file.path) executes the file at file.path in order, just as if you had typed it in. So, the source file should in fact name each function in turn: f1 <- function(x) { ... } f2 <- function(x) { ... } ...etc. So a good way to debug is to just copy and paste lines from your source file into

Re: [R] database table merging tips with R

2008-09-11 Thread Aaron Mackey
Sorry, I see now you want to avoid this, but you did ask what was the "best way to efficiently ...", and the temp. table solution certainly matches your description. What's wrong with using a temporary table? -Aaron On Thu, Sep 11, 2008 at 3:05 PM, Aaron Mackey <[EMAIL PROTECTED]> wrote: > I wou

Re: [R] database table merging tips with R

2008-09-11 Thread Aaron Mackey
I would load your set of userid's into a temporary table in oracle, then join that table with the rest of your SQL query to get only the matching rows out. -Aaron On Thu, Sep 11, 2008 at 2:33 PM, Avram Aelony <[EMAIL PROTECTED]> wrote: > > Dear R list, > > What is the best way to efficiently marr

Re: [R] How to load functions in R

2008-09-11 Thread Adaikalavan Ramasamy
Strange. source() should read all the function in that file unless there was a syntax error or something else preventing the other function from being parsed correctly. Could you send us a simplified example that reproduces this problem? Thanks. Regards, Adai [EMAIL PROTECTED] wrote: H

[R] database table merging tips with R

2008-09-11 Thread Avram Aelony
Dear R list, What is the best way to efficiently marry an R dataset with a very large (Oracle) database table? The goal is to only return Oracle table rows that match IDs present in the R dataset. I have an R data frame with 2000 user IDs analogous to: r = data.frame(userid=round(runif(20

[R] Plot qnorm

2008-09-11 Thread Talina Ruiz
Hi, I have this problem: X is hazardous variable N(mean 2, sd=3) >>question 1) Find the c value, so that P(X>c)=0.10. using R >>question 2) Graph the function N(2,3) and with this graph, explain what you do in question number 1. I just found question number one but not the second one. So, I'd

Re: [R] Calculate mean/var by ID

2008-09-11 Thread Jorge Ivan Velez
Dear Julia, Try also x=read.table(textConnection("IDvalue 111 5 111 6 111 2 178 7 178 3 138 3 138 8 138 7 138 6"),header=TRUE) closeAllConnections() attach(x) do.call(rbind,tapply(value,ID, function(x){ res=c(mean(x,na.rm=TRUE),var(x,na.rm=TRUE)) names(res

Re: [R] how to calcaulate matrices for two subsets

2008-09-11 Thread Adam D. I. Kramer
Hi Bill, Tell me more about the Obs object. The "subset" of an lm should be a vector telling the lm which observations to use...if Obs[197,396] is a single number, only one observation will be used, and chances are your model is not what you intended. Also, predict(result1,newdata=Obs[397,339])

Re: [R] Calculate mean/var by ID

2008-09-11 Thread Adam D. I. Kramer
aggregate(value,list(ID=ID),mean) aggregate(value,list(ID=ID),var) --Adam On Thu, 11 Sep 2008, liujb wrote: Hello, I have a data set that looks like this. IDvalue 111 5 111 6 111 2 178 7 178 3 138 3 138 8 138 7 138 6 . . . I'd like to calculate the me

Re: [R] Calculate mean/var by ID

2008-09-11 Thread Henrique Dallazuanna
Try: with(x, sapply(list(mean, var), function(x)tapply(value, ID, x))) On Thu, Sep 11, 2008 at 2:45 PM, liujb <[EMAIL PROTECTED]> wrote: > > Hello, > > I have a data set that looks like this. > IDvalue > 111 5 > 111 6 > 111 2 > 178 7 > 178 3 > 138 3 > 138 8 > 138

Re: [R] arima and xreg

2008-09-11 Thread David Stoffer
You can have lagged inputs in the xreg statement, you just have to construct the input matrix properly so the dimensions are the same, e.g., x = ts.intersect(mort, trend, part, lag(part,-4)) arima(x[,1],order=c(2,0,1), xreg=x[,2:4]) ... and yes you have to worry about singularities or even multi

Re: [R] fft: from characteristic funtion to density function

2008-09-11 Thread Matthias Kohl
take a look at http://finzi.psych.upenn.edu/R/Rhelp02a/archive/130153.html hth, Matthias Jindan Zhou wrote: Hello all! I've posted the question before but I am still struggling for an answer, please help if you can;-) Suppose a discrete series of data is generated by the following equation: C

[R] Calculate mean/var by ID

2008-09-11 Thread liujb
Hello, I have a data set that looks like this. IDvalue 111 5 111 6 111 2 178 7 178 3 138 3 138 8 138 7 138 6 . . . I'd like to calculate the mean and var for each object identified by the ID. I can in theory just loop through the whole thing..., but is th

[R] creating a package with internal (hiden) S4 classes and methods

2008-09-11 Thread Marie-Pierre Sylvestre
Dear R users, I am writing my first R package and it finally past the R CMD check. Before sending it to CRAN, I would like to check a few issues. 1. I created s4 classes and methods in the package but I want only 1 function (foo) to be available to users and documented in the manual that goe

Re: [R] RSiteSearch for words ``as one entity''.

2008-09-11 Thread Henrik Bengtsson
On Wed, Sep 10, 2008 at 11:33 PM, Prof Brian Ripley <[EMAIL PROTECTED]> wrote: > If firefox is involved on a Mac, that is one difference. My Mac is using > 'open' (the default, I believe) and that is calling Safari (the default, I > believe). > > Yes, it would be the job of browseURL to encode URL

[R] subscript out of bounds

2008-09-11 Thread Dorothy Cheung
I'm working on Human Exon Array 1.0 ST. I'm getting normalized data fine but I'm running into problems with QC. QCReport gives me the following error: > load(file= "huex10stv2cdf.rda") > [EMAIL PROTECTED] <- "huex10stv2cdf" > QCReport(exon.data, file = "QCReport.pdf") Error in as.vector(an

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread Whit Armstrong
probably not pre-canned routines for that, but very easy to implement with the tools provided in the library. Looks like most of what you want to do is fairly simple and not worth the trouble of involving c++. but things like month_durations and year_durations make it clear that the authors have

Re: [R] request: most repeated component of a list

2008-09-11 Thread Adam D. I. Kramer
Did you try my function? I don't see how it doesn't fit the need of this reexplanation. For this set, x would end up equal to c(2,2,1), indicating that array 1 appears twice in the set and array 2 appears twice in the set. So, array 1 and array 2 appear maximally in the set. So, look at a[[1]] or

[R] how to calcaulate matrices for two subsets

2008-09-11 Thread Xianchun Liao
I am an R beginner and trying to run a market model using event study in R framework. First, I run a market model, that is lm(stock security~SP500 index, subset=Obs[197, 396]) ->result1 Then I get predict results for a new dataset using predict (result1, newdata=Obs[397,399]) ->pred1 Pred1 s

[R] [R-pkgs] new RMySQL and new maintainer

2008-09-11 Thread David James
Hello, [This is a re-posting of a previous announcement; I believe the original posting of a couple of days ago didn't go through.] The latest version of RMySQL 0.6-1 is now in CRAN. Please see the NEWS file for more details. Also, I'm happy to announce that Jeff Horner <[EMAIL PROTECTED]> has k

[R] csaps in R port from Octave?

2008-09-11 Thread Dr Carbon
Since I'm getting no joy looking for an R implementation of the matlab function csaps, can anybody advise me on porting csaps from Octave? There is an octave implementation of csaps here: http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/nonfree/spline-gsvspl/inst/csaps.m This fu

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread Gabor Grothendieck
See ?cut.Date In the zoo package see: ?as.yearmon ?as.yearqtr ?aggregate.zoo and the many examples in: ?plot.zoo ?xyplot.zoo as well as the three zoo vignettes. Also in the xts package look at ?to.period For regularly spaced series the tis package supports a wide variety of time bases and can c

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread hadley wickham
> I'm wrapping boost date_time into an R package. I'll post it up to > cran shortly. > > http://www.boost.org/doc/libs/1_36_0/doc/html/date_time.html > > I'm not sure if that is what you are looking for, but there are a lot > of useful utilities in this library. Looks useful, but I didn't see any

Re: [R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread Whit Armstrong
I'm wrapping boost date_time into an R package. I'll post it up to cran shortly. http://www.boost.org/doc/libs/1_36_0/doc/html/date_time.html I'm not sure if that is what you are looking for, but there are a lot of useful utilities in this library. -Whit On Thu, Sep 11, 2008 at 11:02 AM, hadl

Re: [R] How to load functions in R

2008-09-11 Thread Martin Maechler
> "YX" == Yihui Xie <[EMAIL PROTECTED]> > on Thu, 11 Sep 2008 22:47:47 +0800 writes: YX> We may just read them in the R console instead of an external editor, YX> and "fix()" or "edit()" them when we need to make any modifications. A YX> trivial advantage of saving them as

Re: [R] plotCI -- multiple plots on same graph

2008-09-11 Thread brandon
1) Look into plotmeans(), a wrapper function for plotCIit may be more appropriate for what you're looking for and one of the default options is to connect the points with lines. Otherwise you'll have to do a separate call to lines() after each plotCI() call. 2) To put multiple data sets on the

[R] Truncating dates (and other date-time manipulations)

2008-09-11 Thread hadley wickham
Dear all, I've been struggling to perform common operations on dates that I need to be able to correct draw date-time scales - in particular I need to be able to round/truncate/ceiling dates to arbitrary precision - e.g. to weeks, months or years (or multiples thereof). I haven't been able to fin

Re: [R] How to load functions in R

2008-09-11 Thread Mihai.Mirauta
Hello, It seems that all methods work. Source() however loads only the last function. with save(a,b,file="path") i can save more than 1 function. Thanks a lot, Mihai -Ursprüngliche Nachricht- Von: Yihui Xie [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 11. September 2008 16:48 An:

Re: [R] How to load functions in R

2008-09-11 Thread Yihui Xie
We may just read them in the R console instead of an external editor, and "fix()" or "edit()" them when we need to make any modifications. A trivial advantage of saving them as an image file in Windows is that you can double-click the file and R will be started with these objects loaded automatical

[R] Smoothing Spline Clustering

2008-09-11 Thread Marco Chiapello
Hi, I need to use the Smoothing Spline Clustering (SSC): genemerge.bioteam.net/SSClust-Manual.pdf But it doesn't work! If someone can try it and help me! In the folder you will find a file named SSClust.R, but, I do not why, it doesn't work. Also the SSClust.test.R file doesn't work, but it produ

Re: [R] writing simple function through script

2008-09-11 Thread rao fu
Hi Benoit, If you are in the directory that contains your data, you can use > NC60 = read.table("NC60.DATA") # there are some arguments you can use in "read.table" OR >NC60 = read.table("path to your data/NV60.DATA") > yo(NC60) By the way, I do not know your "LgmFormula". I think you already

[R] plotCI -- multiple plots on same graph

2008-09-11 Thread bioinformatics_guy
I have a bunch of lines I want to plot using plotCI() What Id like to know is, how can I connect the points with a line and how can I print multiple lines on the same graph? -- View this message in context: http://www.nabble.com/plotCImultiple-plots-on-same-graph-tp19435198p19435198.html Se

Re: [R] Convex optimization in R?

2008-09-11 Thread roger koenker
I would be very wary of such approaches; my experience is that MM is inferior to the early affine-scaling versions of interior point algorithms for linear programming problems, and modern implementations like the Mehrotra version of the primal dual algorithm are much, much quicker and more r

Re: [R] How to load functions in R

2008-09-11 Thread Adaikalavan Ramasamy
I would recommend saving the functions into a separate file and then using source() as bartjoosen suggested. I do not recommend using save() here because the output is non-readable (even when using ascii=TRUE option). Which means that you have to load() it, then copy-and-paste into an editor b

Re: [R] different results form summarization by loop and sum or rowMeans function

2008-09-11 Thread Prof Brian Ripley
On Thu, 11 Sep 2008, Markus Schmidberger wrote: Hi, I found different results calculating the rowMeans by the function rowMeans() and a simple for-loop. The differences are very low. But after this Indeed, but the C code (rowMeans) is likely to be more accurate as it uses an extended-precis

Re: [R] Mixed effects model with binomial errors - problem

2008-09-11 Thread RFTW
ok... the model now runs properly (say, without errors). Now about the result. These are the averages per treatments tapply(VecesArbolCo.VecesCo.C1,T2,mean) a b c d 0.49 0.56 0.45 0.58 I run this very simple model > summary(model1<-lmer(cbind(VisitsExpTree,TotalVisits-VisitsEx

Re: [R] Convex optimization in R?

2008-09-11 Thread Ravi Varadhan
Ken Lange's MM `algorithm' is a possibility for these non-smooth,, convex problems. It has been implemented in `constrOptim' for handling linear inequality constraints in the minimization of smooth objective functions. I have extended this to nonlinear inequalities. It can be further extended fo

Re: [R] different results form summarization by loop and sum or rowMeans function

2008-09-11 Thread jim holtman
How low is "very low"? This is probably answered by FAQ 7.31 On Thu, Sep 11, 2008 at 9:49 AM, Markus Schmidberger <[EMAIL PROTECTED]> wrote: > Hi, > > I found different results calculating the rowMeans by the function > rowMeans() and a simple for-loop. The differences are very low. But after > t

[R] different results form summarization by loop and sum or rowMeans function

2008-09-11 Thread Markus Schmidberger
Hi, I found different results calculating the rowMeans by the function rowMeans() and a simple for-loop. The differences are very low. But after this calculation I will start some optimization algorithms (BFGS or CG) and there I get huge differences (from the small changes in the beginning or

Re: [R] How to load functions in R

2008-09-11 Thread Yihui Xie
Hi, you may save your functions somewhere on your disk using "save()" and load them next time when you want to use them. See ?save and ?load Yihui On Thu, Sep 11, 2008 at 9:30 PM, <[EMAIL PROTECTED]> wrote: > > Hello, > > I am trying to use self created functions in other scripts than the one >

Re: [R] How to load functions in R

2008-09-11 Thread bartjoosen
Take a look at ?source Mihai.Mirauta wrote: > > > Hello, > > I am trying to use self created functions in other scripts than the one > where they are stored. > For the moment I am using the following structure of commands to do > that: > > 1. Load the text file with the functions in the curr

[R] How to load functions in R

2008-09-11 Thread Mihai.Mirauta
Hello, I am trying to use self created functions in other scripts than the one where they are stored. For the moment I am using the following structure of commands to do that: 1. Load the text file with the functions in the current script: x=parse("path") 2. transform the tex in a function: f1=e

[R] fft: from characteristic funtion to density function

2008-09-11 Thread Jindan Zhou
Hello all! I've posted the question before but I am still struggling for an answer, please help if you can;-) Suppose a discrete series of data is generated by the following equation: CF=exp(-(t^2)/2) which is the characteristic function of a random variable X with standard normal distribution, ho

Re: [R] All possible pairs of two variables

2008-09-11 Thread Yihui Xie
But x is from 0 to "y" instead of a fixed number (say, 10)... If we are to use expand.grid(), we should filter out half of rows in the result: > z = expand.grid(0:10, 0:10) > z[z[,1] <= z[,2], ] Var1 Var2 1 00 12 01 13 11 23 02 24 12 25 22 34

Re: [R] Handling time-series-Data

2008-09-11 Thread Gabor Grothendieck
On Thu, Sep 11, 2008 at 3:37 AM, Kunzler, Andreas <[EMAIL PROTECTED]> wrote: > Dear List, > > I ran into some problems with time-series-Data. > > Imagine a data-structure where observations (x) of test attendants (i) are > made a four times (q) a year (y). The data is orderd the following way: > I

Re: [R] All possible pairs of two variables

2008-09-11 Thread hadley wickham
On Wed, Sep 10, 2008 at 11:34 PM, Ron Michael <[EMAIL PROTECTED]> wrote: > I have two variables (x,y) : > > x : it takes all integer values from 0 to y and, > y : takes all values from 0, 10 > > I am looking for some R code to find all possible pairs of (x,y). Can anyone > please help me? ?expand

Re: [R] yahoo finance into R

2008-09-11 Thread Jeff Ryan
Take a look at quantmod. http://www.quantmod.com http://www.quantmod.com ?getSymbols.yahoo (called by getSymbols) ?getQuote ?yahooQF ?getFin ?getFX HTH Jeff thomastos wrote: > > Hi R, > > I am familiar with the basics of R. > To learn more I would like how to get data from Yahoo!finance di

Re: [R] Package for financial options calculation

2008-09-11 Thread Jeff Ryan
Take a look at the fOptions package, as well as all the packages in Rmetrics (see www.rmetrics.org). There is also a wrapper to QuantLib called RQuantLib. Also, your question would have a better chance of being answered on the R-sig-finance mailing list. HTH Jeff Arun Kumar Saha wrote: > > H

  1   2   >