Re: [R] Convert number to Date

2010-03-26 Thread Prof Brian Ripley
As an example of the perils, Excel actually has two possible origins, which you can select as an option but whose default differs by OS. And one of them has in fact different origins for dates before and after 1900-02-28. From the help for as.Date in R-devel: % http://support.microsoft.com/kb/

Re: [R] Precision level

2010-03-26 Thread Prof Brian Ripley
On Fri, 26 Mar 2010, Rolf Turner wrote: On 26/03/2010, at 12:38 PM, jim holtman wrote: WHen using '==' or '%in%' it is a equality test -- it has to equal zero. If you want a tolerance in the test, use 'all.equal' On Thu, Mar 25, 2010 at 5:29 PM, Dimitri Liakhovitski wrote: Hello! I am wo

[R] Store the model built and Using the same on a later date.

2010-03-26 Thread RAGHAVENDRA PRASAD
Hi, I have a NN model build using AMORE and NNET.If i want to reuse the model built on later date.How can i store this model.In what format should i need to store the model.I wont be saving the session.I want to just store the model and recall this model whenever required.Is it possible to store?

Re: [R] I have a question on nomograms.

2010-03-26 Thread GlenB
R Heberto Ghezzo, Dr wrote: > > On the same topic but from a different perspective. A Nomogram or better > a Line Aligned Nomogram is a graph with 2 or more scales, maybe linear > where by alignig values in each scale you can read values in the other > scale. The relationship can be linear, the

Re: [R] Store the model built and Using the same on a later date.

2010-03-26 Thread RAGHAVENDRA PRASAD
Hi, Thanks for the info.I will try this.But i am working on real time analytics where model is built at some point of time and model needs to be used whenever its required.Storing the workspace and reloading it everytime not sure whether i can fit into real time scenario.l was looking for only sav

Re: [R] I have a question on nomograms.

2010-03-26 Thread GlenB
GlenB wrote: > > > R Heberto Ghezzo, Dr wrote: >> >> Does anybody knows anything about constructing LAN? Any books or already >> rograms to do it? >> > A list of good references is available here: http://www.projectrho.com/nomogram/reading.html -- View this message in context: http://n4.n

Re: [R] Store the model built and Using the same on a later date.

2010-03-26 Thread Prof Brian Ripley
Just save() the model fit. See ?save. On Fri, 26 Mar 2010, RAGHAVENDRA PRASAD wrote: Hi, Thanks for the info.I will try this.But i am working on real time analytics where model is built at some point of time and model needs to be used whenever its required.Storing the workspace and reloading

Re: [R] where do I send typos?

2010-03-26 Thread Iain Gallagher
Best to send any comments on documentation to the author of the documentation. iain --- On Fri, 26/3/10, Xu Wang wrote: > From: Xu Wang > Subject: [R] where do I send typos? > To: r-help@r-project.org > Date: Friday, 26 March, 2010, 5:15 > > Hi, > > I notice several typos when reading docume

Re: [R] netlabR package in English

2010-03-26 Thread Iain Gallagher
Keith Download the netLabR package from http://www.meduniwien.ac.at/user/georg.dorffner/netalg.html i.e. download the .tar.gz or zip files. Inside these, in the inst/doc directory you'll find two English manuals. HTH iain --- On Thu, 25/3/10, Keith McMillan wrote: > From: Keith McMillan >

Re: [R] I have a question on nomograms.

2010-03-26 Thread zhu yao
Totally agreed. Nomogram (or rank table, score table) is just a nice presentation of the model. The development and evaluation of the model is the one that matters. In order to develop a good model, you have to know how to manipulate the data, how to make your model better and suitable. These work

[R] Reverse Y-axis on hist2d diagram

2010-03-26 Thread Ralf B
I created a 2d histogram using gplots' hist2d: hist2d(x,y, freq=TRUE, nbins=50, col = c("white",heat.colors(256))) rug(x, side=1) rug(y, side=2) box() Now I would like to reverse the Y-axis, tried to use ylim=rev(range(1:400)) but seems not to work. Any ideas? Ralf _

[R] Creating a vector of categories

2010-03-26 Thread Christoffer Karlsson
Hi, I have a column in a data frame looking something like: $sex $language $count male english 0 male english 0 female english 32 male spanish 154 female english 11 female norweigan 7 and so on. What I want to do is to order these in to categories, for instance one category where coun

Re: [R] Store the model built and Using the same on a later date.

2010-03-26 Thread RAGHAVENDRA PRASAD
Hi, Thanks it worked.I was looking to save the model in xml format and storing the same in SQL DB.I tried extracting model parameters and storing it.But it dint work.Was not able to recreate the model although have the parameters.Is there anyway of storing the model in SQL Database? Regards, Ra

Re: [R] Absolutely No idea how to plot my Spatial Data

2010-03-26 Thread Babaorumi
Thanks a lot for responding me. Gotta study now... -- View this message in context: http://n4.nabble.com/Absolutely-No-idea-how-to-plot-my-Spatial-Data-tp1691341p1691920.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-projec

[R] image() function

2010-03-26 Thread Jorge Hernandez
Hello. I would like to know how to set the image() function so that it assigns colors relative to an absolute scale, as opposed to relative to the values present in a particular call to image(). For example: m <- matrix(1:18,3,6) par(mfrow = c(2,1)) image(1:6, 1:3, t(m), col = rainbow(20)

Re: [R] where do I send typos?

2010-03-26 Thread Martin Maechler
> "IG" == Iain Gallagher > on Fri, 26 Mar 2010 09:14:14 + (GMT) writes: IG> Best to send any comments on documentation to the author of the documentation. IG> iain yes, indeed. Using R's packageDescription("") will provide you with the e-mail address of the mainta

Re: [R] Store the model built and Using the same on a later date.

2010-03-26 Thread Prof Brian Ripley
On Fri, 26 Mar 2010, RAGHAVENDRA PRASAD wrote: Hi, Thanks it worked.I was looking to save the model in  xml format and storing the same in  SQL DB.I tried extracting model parameters and storing it.But it dint work.Was not able to recreate the model although have the parameters.Is there anywa

Re: [R] Read SAS data

2010-03-26 Thread Nicola Sturaro Sommacal
On Thu, Mar 25, 2010 at 19:32, Nordlund, Dan (DSHS/RDA) wrote: > > Here is one work-around for sas.get on MS Windows platforms. > > http://finzi.psych.upenn.edu/Rhelp10/2008-December/182573.html Hi and thank you very much! I try solutions #2 and #3 and I found that last one works. Thank you.

Re: [R] Creating a vector of categories

2010-03-26 Thread Jim Lemon
On 03/26/2010 08:41 PM, Christoffer Karlsson wrote: Hi, I have a column in a data frame looking something like: $sex $language $count male english 0 male english 0 female english 32 male spanish 154 female english 11 female norweigan 7 and so on. What I want to do is to order these

Re: [R] using reorder in dotplot

2010-03-26 Thread Deepayan Sarkar
On Tue, Mar 23, 2010 at 7:21 AM, Veerappa Chetty wrote: > Hi, > Please help to correct my error in the following. I want to plot the values > of 'x" in increasing order. > --- > library(lattice) > Name<-c("A","B","C") > x<-c(15,20,10) > test<-data.frame(Name,x) > do

[R] Odp: Creating a vector of categories

2010-03-26 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 26.03.2010 10:41:29: > Hi, > > I have a column in a data frame looking something like: > > $sex $language $count > male english 0 > male english 0 > female english 32 > male spanish 154 > female english 11 > female norweigan 7 > > and so on

Re: [R] Add title to color spectrum legend in xyplot

2010-03-26 Thread Deepayan Sarkar
On Tue, Mar 23, 2010 at 4:28 AM, Nick Ackerman wrote: > > Hi, > > I have a plot that is essentially the same as that in Figure 5.6 of "Lattice > - Multivariate Data Visualization with R". The key difference is that I > would like to add a title to top of the grey color spectrum legend, but have >

Re: [R] Abstract classes

2010-03-26 Thread Albert-Jan Roskam
Hi Charlie, Thank you! I will certainly follow your advice. Cheers!! Albert-Jan ~~ In the face of ambiguity, refuse the temptation to guess. ~~ --- On Thu

Re: [R] Creating a vector of categories

2010-03-26 Thread Sharpie
Christoffer Karlsson wrote: > > Hi, > > I have a column in a data frame looking something like: > > $sex $language $count > male english 0 > male english 0 > female english 32 > male spanish 154 > female english 11 > female norweigan 7 > > and so on. > What I want to do is to order

Re: [R] Creating a vector of categories

2010-03-26 Thread Sharpie
Sharpie wrote: > > testData$bin <- cut( testData$count, binBreaks, include.lowest = TRUE ) > I also made a slight mistake, you will want to replace inclde.lowest = TRUE with right = FALSE to the call to cut() to preserve the greater-than-or-equal boundary at the lower end of each bin. Sorry

Re: [R] How can I make a lattice::levelplot block size uniform

2010-03-26 Thread Deepayan Sarkar
On Fri, Mar 26, 2010 at 7:03 AM, Lao Tse wrote: > Dear lattice::levelplot users, > > I would like to use levelplot to plot uniformly sized blocks. > > Here is an example: > > require (lattice) > u = runif(10) * 10 > v = runif(10) * 10 > z = runif(10) > levelplot ( z ~ u + v, aspect="iso" ) > > The

Re: [R] 3 levelplots and 1 colorbar

2010-03-26 Thread Deepayan Sarkar
On Fri, Mar 26, 2010 at 12:46 AM, Joaquin Rapela wrote: > > I want to create a simple plot containing three levelplots with one colorbar. > I used the "Three levelplots" code below, but the third levelplot is drawn > smaller than the first two. However, if I try the "Two levelplots" code below > i

[R] predict

2010-03-26 Thread Kay Cichini
hello, sorry to have hassled you with this - in the end it is all quite simple and after digging deeper into the help files, also of predict.lm, i finally managed to do it. here is the worked example with solution for anyone beeing clumsy as i was: ###

[R] NA values in indexing

2010-03-26 Thread Barry Rowlingson
If you index a vector with a vector that has NA in it, you get NA back: > x=101:107 > x[c(NA,4,NA)] [1] NA 104 NA > x[c(4,NA)] [1] 104 NA All well and good. ?"[" says, under NAs in indexing: When extracting, a numerical, logical or character ‘NA’ index picks an unknown element

Re: [R] Absolutely No idea how to plot my Spatial Data

2010-03-26 Thread Eik Vettorazzi
Hi, Peter Alspach schrieb: Tena korua Also, bear in mind that colours can be specified as grey0 - grey100; i.e., paste('grey', round(100*z/max(z), 0), sep=''). or a lot easier using the built-in function col=gray(z/max(z)) Also, the colorspace package is worth considering if you are not res

[R] Tukey test on ANCOVA

2010-03-26 Thread Michael Rennie
Michael Rennie wrote: Hi Paul, Short answer is you don't. Instead, you estimate your adjusted means, and then compare adjusted means using one of a couple of different options- Quinn and Keough (2002, Experimental design and data analysis for biologists) suggests then using specific comparis

Re: [R] survival data with competing risks and time-dependent covariates!

2010-03-26 Thread David Winsemius
Are you sure you are using coxphf correctly for this purpose. Since you have not identified what package your function comes from, it's not possible for me to check the appropriate help page, but had you been using the coxph function in the survival package, you would have been using the cl

[R] R, S, S-Plus, whence comes thy name?

2010-03-26 Thread John Sorkin
I appeal to those entrusted with the keeping of the R flame, the S flame, and the S-Plus flame to relate a bit of history. How did S, S-Plus, and R get their names? Going from S to S-Plus appears clear, a commercial company purchased rights to S, developed a product that they wanted to indicate

[R] More efficient alternative to combn()?

2010-03-26 Thread elgorgonzola
Hi, i am working on a problem where i need to compute the products of all possible combinations of size m of the elements of a vector. I know that this can be achieved using the function combn(), e.g.: > vector <- 1:6 > combn(x = vector, m = 3, FUN = function(y) prod(y)) In my case the vector h

Re: [R] More efficient alternative to combn()?

2010-03-26 Thread Sharpie
elgorgonzola wrote: > > Hi, > > i am working on a problem where i need to compute the products of all > possible combinations of size m of the elements of a vector. I know that > this can be achieved using the function combn(), e.g.: > >> vector <- 1:6 >> combn(x = vector, m = 3, FUN = functio

[R] how to measure accuracy of regression tree?

2010-03-26 Thread vibha patel
Hello, for constructing regression tree, I am using rpart function. now after dividing dataset in to training and testing, I'm using predict for forecasting. how to measure accuracy of the predicted data? Thanks and Regards, Vibha. [[alternative HTML version deleted]]

Re: [R] R, S, S-Plus, whence comes thy name?

2010-03-26 Thread Kevin Wright
Google "history of S" to find this document www2.research.att.com/areas/stat/doc/94.11.ps with the following quote: By July, 1976, we decided to name the system. Acronyms were in abundance at Bell Laboratories, so it seemed sure that we would

[R] Problems if optimization

2010-03-26 Thread Francisco Silva
What's up fellows... I am a begginer in R and i am trying to find the parameters of one likelihood function, but when i otimize it, always appers a error or advertisement and the solve does not occur. The problem seems like that: "lMix<-function(pars,y){ beta1<-pars[1] beta2<-pars[2] beta3<-pars

[R] row names in regression results and saving the identification results from added variable plots

2010-03-26 Thread Simon Kiss
Hello all, Is there a way to take the row names from my data.frame and have them imported to the regression results? At the moment, I my original data frame looks like this: / Riding name / Turnout / Margin / Expenditures 1 / Abbotsford 2 / . 3 / . 4 / .Willow I know how to set the row names f

[R] Help with assigning a value based on existing numbers

2010-03-26 Thread Jessica Cathro
Hi All I have a column/variable called time difference. It has a whole list of numbers from 0 through to the hundreds eg 236. I want to assign a corresponding "name" to each variable from a predefined list: Month or less, 1 -2 months, 2-3 months etc So the result would look something like: Tim

[R] similarity measure

2010-03-26 Thread karuna m
hi all, I am doing hierarchical clustering using similarity measures for binary data using package ade4 and hclust function. For method=8 and method = 9 of dist.binary, I am getting Na values. Hence, hclust function is giving error as Error in hclust(d8, method = "ward") :   NA/NaN/Inf in foreig

[R] Please help Me(R Language)

2010-03-26 Thread SADANANDAM MADDELA
Hi thank you very much for advanced help. I am new to R language.. I am using r language with asp.net. while i am run below code. the graphics window open out side of my *.aspx *page(it is opened as a *pop up*window) .i need to open that window with in my . *aspx *page(without using( png,jpg e

[R] R-help

2010-03-26 Thread SADANANDAM MADDELA
Hi thank you very much for advanced help. I am new to R language.. I am using r language with asp.net. while i am run below code. the graphics window open out side of my *.aspx *page(it is opened as a *pop up*window) .i need to open that window with in my . *aspx *page(without using( png,jpg e

[R] R Crashing when trying to open script or load workpace

2010-03-26 Thread Musal
Hello all, I am using Windows XP and R 2.10.1. When using the "Open Script" or "Load Workspace" File menu items, R tends to shut down. This does not happen while I am writing the script within R or R is running a script. I used to have this problem with a much earlier version of R. When I started

Re: [R] Creating a vector of categories

2010-03-26 Thread Christoffer Karlsson
Thanks a ton guys for your help! Saved me a boat load of time and helped me develop a much better method of doing these things than I had in the past. The method I ended up using was to cut up my counts and aggregating my data as suggested by Petr. Thanks! Chris On Fri, Mar 26, 2010 at 12:05 PM,

[R] Odp: Help with assigning a value based on existing numbers

2010-03-26 Thread Petr PIKAL
Hi again a work for cut. See ?cut and notice a labels option. Regards Petr r-help-boun...@r-project.org napsal dne 26.03.2010 11:37:20: > Hi All > > I have a column/variable called time difference. It has a whole list of > numbers from 0 through to the hundreds eg 236. I want to assign a >

Re: [R] R, S, S-Plus, whence comes thy name?

2010-03-26 Thread Ted Harding
On 26-Mar-10 12:30:37, John Sorkin wrote: > I appeal to those entrusted with the keeping of the R flame, > the S flame, and the S-Plus flame to relate a bit of history. > How did S, S-Plus, and R get their names? Going from S to S-Plus > appears clear, a commercial company purchased rights to S, >

Re: [R] how to measure accuracy of regression tree?

2010-03-26 Thread Frank E Harrell Jr
vibha patel wrote: Hello, for constructing regression tree, I am using rpart function. now after dividing dataset in to training and testing, I'm using predict for forecasting. Such data splitting yields unreliable validations unless N > 20,000. Frank how to measure accuracy of the predict

[R] grid graphics - concatenating gLists - is there a function?

2010-03-26 Thread Mark Heckmann
I have to gList objects containing several grobs. Now, I want to combine them into a single gList object as e.g. gTree() does not take a nested gList as children argument. gl1 <- gList(rectGrob(), rectGrob()) gl2 <- gList(textGrob("Text 1")) Now I want to combine gl1 and gl2 into a single gList

[R] pause/break between execution of two commands

2010-03-26 Thread Jannis
Dears, is there any way to include a pause or break for example of 5 seconds between the execution of two commands in R? I found some stuff in other packages (pause {DAAG} ...) but I am having trouble installing custom packages due to insufficient user rights anyway, so I am looking for a way

[R] return.replicates in survey pkg

2010-03-26 Thread Richard Valliant
How do I retrieve the replicates estimates from a crosstab done using svyby? Here is an example from the help page for svyby in the package: > data(api) > dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) > rclus1<-as.svrepdesign(dclus1) > > a <- svyby(~api99, ~stype, rclus1, svym

Re: [R] R, S, S-Plus, whence comes thy name?

2010-03-26 Thread John Sorkin
Thank you. John John Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics Baltimore VA Medical Center GRECC, University of Maryland School of Medicine Claude D. Pepper OAIC, University of Maryland Clinical Nutrition Research Unit, and Baltimore VA Center Stroke of Excellence University of Mary

Re: [R] pause/break between execution of two commands

2010-03-26 Thread Ista Zahn
Hi, See ?Sys.sleep -Ista On Fri, Mar 26, 2010 at 10:29 AM, Jannis wrote: > Dears, > > > > is there any way to include a pause or break for example of 5 seconds between > the execution of two commands in R? I found some stuff in other packages > (pause {DAAG} ...) but I am having trouble instal

[R] Discrete values in levelplot?

2010-03-26 Thread Filipe Cadete
Dear all, I am trying represent a matrix of discrete values. At the moment I am using levelplot from the lattice package, but it seems to only work with numerical values. Is there an option in levelplot that will allow me to assign a color to a discrete value, or another package that will do th

Re: [R] Help with assigning a value based on existing numbers

2010-03-26 Thread sjaffe
An expression like "v >= 52", where v is a vector, will produce a vector resulting from comparing each entry -- that is why you see the message. What you want to do is logical subscripting. For example names <- character( nrow( curveData ) ) names[ curvedata$Date.difference <= 29 ] = "< 1 mon

[R] distance matrix, podani, package: proxy

2010-03-26 Thread Kim Vanselow
Dear r-helpers, I just wanted to calculate a distance matrix using the function dist, with method = 'Podani' (package: proxy). The calculation is starting without error. Now the hourglass is running and won't stop. Since more than 20 hours! I do not think that the problem is with my input matrix.

[R] Poisson Lognormal

2010-03-26 Thread Robert Ruser
Hi R Users, I'm going to estimate via. ML the parameters in Poisson Lognormal model. The model is: x | lambda ~ Poisson(lambda) lambda ~ Lognormal(a,b) Unfortunately, I haven't found a useful package allowing for such estimation. I tried to use "poilog" package, but there is no equations and it's

Re: [R] image() function

2010-03-26 Thread Greg Snow
Use the zlim argument to image: m <- matrix(1:18,3,6) par(mfrow = c(2,1)) image(1:6, 1:3, t(m), col = rainbow(20), zlim=c(0,30)) image(1:6, 1:3, t(m+9), col = rainbow(20), zlim=c(0,30)) hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@

Re: [R] Sweave running R chunks for figure generation several times

2010-03-26 Thread Greg Snow
Is the order consistent? Meaning that the pdf/eps producing run always comes second? If so, then set a variable to FALSE and when you get to the plotting code have an if statement on that variable, if it is FALSE then set it to TRUE, if it is TRUE then run the plotting code. This way it only

Re: [R] Create blocks or observations

2010-03-26 Thread Greg Snow
[snip] > > group <- unlist( lapply( 1:numGroups, rep.int, times = 3 ) ) This can be done simpler with: group <- rep(1:numgroups, each=3) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111

Re: [R] Selecting Best Model in an anova.

2010-03-26 Thread Greg Snow
This really depends on what question you are trying to answer, and for some questions the "Best" model is not one of the 2 you show. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-bou

Re: [R] Precision level

2010-03-26 Thread Dimitri Liakhovitski
Thanks a lot - it's been helpful. Look like it has to be pretty darn close to zero to be considered = 0. D. On Fri, Mar 26, 2010 at 3:22 AM, Prof Brian Ripley wrote: > On Fri, 26 Mar 2010, Rolf Turner wrote: > >> >> On 26/03/2010, at 12:38 PM, jim holtman wrote: >> >>> WHen using '==' or '%in%' i

Re: [R] Problems if optimization

2010-03-26 Thread Berend Hasselman
Francisco Silva wrote: > > > I am a begginer in R and i am trying to find the parameters of one > likelihood function, but when i otimize it, always appers a error or > advertisement and the solve does not occur. > The problem seems like that: > > "lMix<-function(pars,y){ > > Shouldn't

Re: [R] NA values in indexing

2010-03-26 Thread Matthew Dowle
The type of 'NA' is logical. So x[NA] behaves more like x[TRUE] i.e. silent recycling. > class(NA) [1] "logical" > x=101:108 > x[NA] [1] NA NA NA NA NA NA NA NA > x[c(TRUE,NA)] [1] 101 NA 103 NA 105 NA 107 NA > x[as.integer(NA)] [1] NA HTH Matthew "Barry Rowlingson" wrote in message news

Re: [R] NA values in indexing

2010-03-26 Thread Gabor Grothendieck
Try > x <- 101:107 > x[c(NA_integer_, NA_integer_)] [1] NA NA On Fri, Mar 26, 2010 at 8:09 AM, Barry Rowlingson wrote: > If you index a vector with a vector that has NA in it, you get NA back: > >  > x=101:107 >  > x[c(NA,4,NA)] >  [1]  NA 104  NA >  > x[c(4,NA)] >  [1] 104  NA > > All well and

[R] how to make stacked plot?

2010-03-26 Thread sdzhangping
Dear friends: I'm interested to make a stacked plot of cumulative incidence. that's, the cuminc model is fitted [fit=cuminc(time, relapse)] and cumulative incidence is in place. I'd like to stack the cuminc plots (relapse of luekemia and death free from leukemia, for example) , then th

[R] Off Topic: teenie weenie numbers -- Was: Precision level

2010-03-26 Thread Bert Gunter
*** COMPLETELY OFF TOPIC *** Although machine precision (smallest numerical values that can be exactly represented) is important for numerical calculations, what is the smallest number that anyone has actually seen describing physical phenomena in science? I've seen values of ca. 1e-20 or so rout

[R] Reading a SpreadsheetML / XMLNS into R xmlns="urn:schemas-microsoft-com:office:spreadsheet

2010-03-26 Thread stefan.d...@gmail.com
Hello, I use a software that outputs the data in a form/dialect(?) of xml (I think its called "SpreadsheetML", see below for an excerpt). It allows (admittedly) easy import of such files into Excel. I would like, however, to import it directly into R. I am familiar how to do that with standard xml-

Re: [R] NA values in indexing

2010-03-26 Thread Bert Gunter
Is this, from the man page, relevant? "An empty index selects all values: this is most often used to replace all the entries but keep the attributes. " Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org

[R] question regarding conversion from factor to vector

2010-03-26 Thread Oliver Kullmann
Hello, let me show you the following part of a session: > table(E$singles) 0 1 2 3 4 5 6 7 8 14 15 461752 5487 93224379658 1099 4053 2 1868 1 21 28 29 35 42 49 50 56 63 7

[R] tapply syntax

2010-03-26 Thread Min-Han Tan
Dear R-help members, Apologies for the trouble. I have a question : Essentially, I have a dataset which stores genetic variations for individual patients. Each individual patient can have more than one variation, and each new record corresponds to a new variation (thus, both individual patients

Re: [R] whisker definition

2010-03-26 Thread S Ellison
>>> James Rome 26/03/2010 02:38 >>> >What is the definition of the whiskers in the ggplot2 qplot with geom="boxplot"? See http://had.co.nz/ggplot2/stat_boxplot.html >Why is it so hard to find? Pass. It only took me a couple of hops from the geom_boxplot html help page,, but I can see that I g

Re: [R] NA values in indexing

2010-03-26 Thread Barry Rowlingson
On Fri, Mar 26, 2010 at 4:15 PM, Bert Gunter wrote: > Is this, from the man page, relevant? > > "An empty index selects all values: this is most often used to replace all > the entries but keep the attributes. " No, I think that means doing "x[]", and only in replacement: > x=101:105 > attr(x,"

Re: [R] 1 - Survival Plot

2010-03-26 Thread Euphoria
Thanks for the responses guys! It worked like a charm! =) -- View this message in context: http://n4.nabble.com/1-Survival-Plot-tp1691512p1692516.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:

Re: [R] NA values in indexing

2010-03-26 Thread Barry Rowlingson
On Fri, Mar 26, 2010 at 4:15 PM, Matthew Dowle wrote: > The type of 'NA' is logical. So x[NA] behaves more like x[TRUE] i.e. silent > recycling. > >> class(NA) > [1] "logical" >> x=101:108 >> x[NA] > [1] NA NA NA NA NA NA NA NA >> x[c(TRUE,NA)] > [1] 101  NA 103  NA 105  NA 107  NA > >> x[as.integ

Re: [R] tapply syntax

2010-03-26 Thread Min-Han Tan
Hi, I figured a workaround to my problem, but if anyone has any advice on how to express a function in tapply to achieve the same outcome, that would be awesome and I'd learn something about functions! The workaround was tapply ((data$Variation.Type %in% c(2,3)), data$Patient, sum) Thanks. Min-

Re: [R] Off Topic: teenie weenie numbers -- Was: Precision level

2010-03-26 Thread Barry Rowlingson
On Fri, Mar 26, 2010 at 4:31 PM, Bert Gunter wrote: > *** COMPLETELY OFF TOPIC *** > > Although machine precision (smallest numerical values that can be exactly > represented) is important for numerical calculations, what is the smallest > number that anyone has actually seen describing physical p

Re: [R] tapply syntax

2010-03-26 Thread David Freedman
how about: d1=data.frame(pat=c(rep('a',3),'b','c',rep('d',2),rep('e',2),'f'),var=c(1,2,3,1,2,2,3,2,4,4)) ds=set(d1,var %in% c(2,3)) with(ds,tapply(var,pat,FUN=length)) hth, David Freedman, CDC, Atlanta -- View this message in context: http://n4.nabble.com/tapply-syntax-tp1692503p1692553.html S

Re: [R] More efficient alternative to combn()?

2010-03-26 Thread Charles C. Berry
On Fri, 26 Mar 2010, elgorgonzola wrote: Hi, i am working on a problem where i need to compute the products of all possible combinations of size m of the elements of a vector. I know that this can be achieved using the function combn(), e.g.: vector <- 1:6 combn(x = vector, m = 3, FUN = func

Re: [R] Poisson Lognormal

2010-03-26 Thread Charles C. Berry
On Fri, 26 Mar 2010, Robert Ruser wrote: Hi R Users, I'm going to estimate via. ML the parameters in Poisson Lognormal model. The model is: x | lambda ~ Poisson(lambda) lambda ~ Lognormal(a,b) Unfortunately, I haven't found a useful package allowing for such estimation. So this is the genera

[R] [R-pkgs] New package: equate

2010-03-26 Thread Tony Albano
The 'equate' package, designed for statistical equating (non-IRT) of test score distributions, is available on CRAN: http://cran.r-project.org/package=equate The package was developed for both research and teaching purposes, and will hopefully be useful for both. A vignette introduces the basic

Re: [R] string problems in R

2010-03-26 Thread muting
Hi Charlie Thank you for your advice, but it makes my R dead... My head(v.fundno) is > head(v.fundno) [1] "2899" "2903" "2960" "3094" "3095" "3211" I tried to plug in the specific value like 2890 and 2960 : gmret.2899<-sqlQuery(channel,"select caldt, mret from Monthly_returns where crsp_fundno

Re: [R] string problems in R

2010-03-26 Thread jim holtman
try this: x <- lapply(v.fundno, function(.fund){ sqlQuery(channel, paste("select mret from monthly_return where crsp_fundno =", .fund, 'and caldt > 19700630 order by caldt') }) result <- do.call(rbind, x) On Fri, Mar 26, 2010 at 2:07 PM, muting wrote: > > Hi Charlie > > Thank you fo

[R] Multilevel modeling with count variables

2010-03-26 Thread dadrivr
I am using a multilevel modeling approach to model change in a person's symptom score over time (i.e., longitudinal individual growth models). I have been using the lme function in the multilevel package for the analyses, but my problem is that my outcome (symptoms) and one of my predictors (even

Re: [R] More efficient alternative to combn()?

2010-03-26 Thread elgorgonzola
Hi Chuck, thanks for the reply. I am not actually interested in all the individual products but the sum of the products. So you wouldn't have to store all the values just the sum. El -- View this message in context: http://n4.nabble.com/More-efficient-alternative-to-combn-tp1692117p1692629.htm

[R] regular expression

2010-03-26 Thread arnaud chozo
Hi, I need to select a substring from the filename of a file in a list. I can find all the filenames in a directory by list.files(fn_dir) Each filename has the format (the following is an example because field lengths are variable) XXX184_YYY_ZZZ.dat XXX: 2 or 3 alphabetic characters 184: 3 nu

Re: [R] ggplot2: How to remove legend component for geom_errorbar() ?

2010-03-26 Thread James Rome
In general, one should be able to turn off the legend entirely. I did a plot with geom_jitter() and then overlaid it with geom_boxplot() and I got a legend with a sort of box drawn in a legend that was meaningless since there was no factor involved. Jim -- View this message in context: http://n

Re: [R] Off Topic: teenie weenie numbers -- Was: Precision level

2010-03-26 Thread Steve Lianoglou
On Fri, Mar 26, 2010 at 1:11 PM, Barry Rowlingson wrote: > On Fri, Mar 26, 2010 at 4:31 PM, Bert Gunter wrote: >> *** COMPLETELY OFF TOPIC *** >> >> Although machine precision (smallest numerical values that can be exactly >> represented) is important for numerical calculations, what is the small

Re: [R] regular expression

2010-03-26 Thread jim holtman
try this: > x <- c("XXX184_YYY_ZZZ.dat", "YY123_YY_ZZ.dat") > sub("(^[[:alpha:]]+)[[:digit:]]+.*", "\\1 ", x, perl=TRUE) [1] "XXX" "YY" > On Fri, Mar 26, 2010 at 2:27 PM, arnaud chozo wrote: > Hi, > > I need to select a substring from the filename of a file in a list. > I can find all the filen

Re: [R] string problems in R

2010-03-26 Thread muting
Hi Charlie: I tried gmret<-sqlQuery(channel, paste( "select mret from Monthly_returns where crsp_fundno =", v.fundno[1] ) ) It works well.. I think you got my problem solved,R just need time to run the loop, not dead.. Thank you very much Muting -- View this message in context: http:/

Re: [R] string problems in R

2010-03-26 Thread muting
Thank you I am waiting for the R to finish running the loop..I hope it will work.. muting Quoting "jholtman [via R]" : > > > > try this: > > x <- lapply(v.fundno, function(.fund){ >sqlQuery(channel, paste("select mret from monthly_return where > crsp_fundno =", >.fund, 'and caldt >

Re: [R] R, S, S-Plus, whence comes thy name?

2010-03-26 Thread Ben Bolker
John Sorkin grecc.umaryland.edu> writes: > How did S, S-Plus, and R get their names? From http://stat.bell-labs.com/S/ http://cm.bell-labs.com/stat/doc/94.11.ps by Rick Becker By July, 1976, we decided to name the system. Acronyms were in abundance at Bell Laboratories, so it seemed su

[R] smart way to turn a vector into a matrix

2010-03-26 Thread anna
Hello guys, I am working on a matrix which looks like this one: > initialMatrix <- > rbind(cbind(rep("A",3),seq(1,3)),cbind(rep("B",4),seq(1,4)),cbind(rep("C",3),seq(1,3))) > initialMatrix [,1] [,2] [1,] "A" "1" [2,] "A" "2" [3,] "A" "3" [4,] "B" "1" [5,] "B" "2" [6,] "B" "3

[R] Linear mixed models with custom link functions in R

2010-03-26 Thread Daniel Barton
Hello All, I am looking for an R library/function that allows the specification of a custom link function in a linear mixed model. I've been using glm() in library MASS to fit fixed-effect models with a custom link but my study design demands mixed models. Any suggestions on the best R li

Re: [R] smart way to turn a vector into a matrix

2010-03-26 Thread anna
I tried to use ave() as well but it didn't work either... - Anna Lippel -- View this message in context: http://n4.nabble.com/smart-way-to-turn-a-vector-into-a-matrix-tp1692671p1692685.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] smart way to turn a vector into a matrix

2010-03-26 Thread Phil Spector
Anna - Does this do what you want? parts = split(initialMatrix,initialMatrix[,1]) parts = lapply(parts,function(x)matrix(x,ncol=2)) parts $A [,1] [,2] [1,] "A" "1" [2,] "A" "2" [3,] "A" "3" $B [,1] [,2] [1,] "B" "1" [2,] "B" "2" [3,] "B" "3" [4,] "B" "4" $C [,1] [,2]

Re: [R] smart way to turn a vector into a matrix

2010-03-26 Thread Erik Iverson
Hello, anna wrote: Hello guys, I am working on a matrix which looks like this one: initialMatrix <- rbind(cbind(rep("A",3),seq(1,3)),cbind(rep("B",4),seq(1,4)),cbind(rep("C",3),seq(1,3))) initialMatrix [,1] [,2] [1,] "A" "1" [2,] "A" "2" [3,] "A" "3" [4,] "B" "1" [5,] "B" "

Re: [R] smart way to turn a vector into a matrix

2010-03-26 Thread anna
YES Phil!!! Thank you so much I was completely stuck! I still have a lot to learn on R :) You're the boss! - Anna Lippel -- View this message in context: http://n4.nabble.com/smart-way-to-turn-a-vector-into-a-matrix-tp1692671p1692702.html Sent from the R help mailing list archive at Nabble.

Re: [R] smart way to turn a vector into a matrix

2010-03-26 Thread anna
Oh this is a great answer too thanks erik! - Anna Lippel -- View this message in context: http://n4.nabble.com/smart-way-to-turn-a-vector-into-a-matrix-tp1692671p1692711.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-pr

Re: [R] smart way to turn a vector into a matrix

2010-03-26 Thread Erik Iverson
anna wrote: Oh this is a great answer too thanks erik! - Anna Lippel It was really the same answer as Phil. Notice if you use a data.frame instead of a matrix, you don't have to recast to a 'matrix'-like form, and therefore the split call is a little simpler. Depending on what you're

  1   2   >