Re: [R] accessing and preserving list names in lapply

2009-02-27 Thread Romain Francois
Hi, This might be the trick you are looking for: http://tolstoy.newcastle.edu.au/R/e4/help/08/04/8720.html Romain Alexy Khrabrov wrote: res - lapply(1:length(L),do.one) Actually, I do res - lapply(:length(L),function(x)do.one(L[x])) -- this is the price of needing the element's name, so I

[R] Problem with RBloomberg (not the usual one)

2009-02-27 Thread Sergey Goriatchev
Hello, everyone! I have a problem with RBloomberg and this is not the usual no administrator rights problem. I have R 2.7.2, RBloomberg 0.1-10, RDCOMclient 0.92-0 RDCOMClient, chron, zoo, stats: these packages load OK. Then, trying to connect, I get following error message: conn -

[R] combining identify() and locator()

2009-02-27 Thread Brian Bolt
Hi, I am wondering if there might be a way to combine the two functions identify() and locator() such that if I use identify() and then click on a point outside the set tolerance, the x,y coordinates are returned as in locator(). Does anyone know of a way to do this? Thanks in advance for

Re: [R] Installing different versions of R simultaneously on Linux

2009-02-27 Thread Berwin A Turlach
G'day Rainer, On Fri, 27 Feb 2009 09:34:11 +0200 Rainer M Krug r.m.k...@gmail.com wrote: I want to install some versions of R simultaneously from source on a computer (running Linux). [...] What flavour of Linux are we talking about? If it is not, how is it possible to have several versions

Re: [R] survival::survfit,plot.survfit

2009-02-27 Thread Heinz Tuechler
At 15:28 26.02.2009, Terry Therneau wrote: plot(survfit(fit)) should plot the survival-function for x=0 or equivalently beta'=0. This curve is independent of any covariates. This is not correct. It plots the curve for a hypothetical subject with x= mean of each covariate. Does this

Re: [R] combining identify() and locator()

2009-02-27 Thread Barry Rowlingson
2009/2/27 Brian Bolt bb...@kalypsys.com: Hi, I am wondering if there might be a way to combine the two functions identify() and locator() such that if I use identify() and then click on a point outside the set tolerance, the x,y coordinates are returned as in locator().  Does anyone know of a

Re: [R] Download daily weather data

2009-02-27 Thread Pfaff, Bernhard Dr.
Dear Thomas, more for the sake of completeness and as an alternative to R. There are GRIB data [1] sets available (some for free) and there is the GPL software Grads [2]. Because the Grib-Format is well documented it should be possible to get it into R easily and make up your own plots/weather

[R] Axis-question

2009-02-27 Thread Antje
Hi there, I was wondering wether it's possible to generate an axis with groups (like in Excel). So that you can have something like this as x-axis (for example for the levelplot-method of the lattice package): --- | X1 | X2 | X3 | X1 | X2 |

Re: [R] accessing and preserving list names in lapply

2009-02-27 Thread baptiste auguie
Hi, Perhaps Hadley's plyr package can help, library(plyr) temp - list(x=2,y=3,x=4) llply(temp, function(x) x^2 ) $x [1] 4 $y [1] 9 $x [1] 16 baptiste On 27 Feb 2009, at 03:07, Alexy Khrabrov wrote: Sometimes I'm iterating over a list where names are keys into another data structure,

[R] combining identify() and locator()

2009-02-27 Thread Brian Bolt
Hi, I am wondering if there might be a way to combine the two functions identify() and locator() such that if I use identify() and then click on a point outside the set tolerance, the x,y coordinates are returned as in locator(). Does anyone know of a way to do this? Thanks in advance for

[R] Balanced design, differences in results using anova and lmer/anova

2009-02-27 Thread Lars Kunert
Hi, I am trying to do an analysis of variance for an unbalanced design. As a toy example, I use a dataset presented by K. Hinkelmann and O. Kempthorne in Design and Anaylysis of Experiments (p353-356). This example is very similar to my own dataset, with one difference: it is balanced. Thus it is

Re: [R] Using package ROCR

2009-02-27 Thread wiener30
Just an update concerning an error message in using ROCR package. Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double' I have changed the sequence of loading the packages and the problem has gone: library(ROCR) library(randomForest) The loading sequence that caused an

Re: [R] bottom legends in ggplot2 ?

2009-02-27 Thread ONKELINX, Thierry
I would think that the lines below should work but they give an error. Hadley, can you clarify this? Cheers, Thierry library(ggplot2) qplot(mpg, wt, data=mtcars, colour=cyl) + opts(legend.position = bottom) Error in grid.Call.graphics(L_setviewport, pvp, TRUE) : Non-finite location and/or

Re: [R] gplot problems with faceting

2009-02-27 Thread ONKELINX, Thierry
Dear Pascal, I thik you need to define the facets as facets = ~ Par Instead of facets = Par ~ . The Par ~ . Syntax can be used with facet_grid and not with facet_wrap. HTH, Thierry ir. Thierry

[R] rounding problem

2009-02-27 Thread Peterko
hi i am creating some variables from same data, but somewhere is different rouding. look: P = abs(fft(d.zlato)/480)^2 hladane= sort(P,decreasing=T)[1:10]/480 pozicia=c(0,0,0,0,0) for (j in 1:5){ for (i in 2:239){ if (P[i]/480==hladane[2*j-1]){pozicia[j]=i-1}}} period=479/pozicia

Re: [R] Installing different versions of R simultaneously on Linux

2009-02-27 Thread Prof Brian Ripley
This is really an R-devel question. On Fri, 27 Feb 2009, Rainer M Krug wrote: Hi I want to install some versions of R simultaneously from source on a computer (running Linux). Some programs have an option to specify a suffix for the executable (eg R would become R-2.7.2 when the suffix is

Re: [R] rounding problem

2009-02-27 Thread baptiste auguie
Hi, you probably want to use ?all.equal instead of == I couldn't run your example, though Hope this helps, baptiste On 27 Feb 2009, at 10:32, Peterko wrote: hi i am creating some variables from same data, but somewhere is different rouding. look: P = abs(fft(d.zlato)/480)^2 hladane=

Re: [R] Installing different versions of R simultaneously on Linux

2009-02-27 Thread Wacek Kusnierczyk
Prof Brian Ripley wrote: This is really an R-devel question. On Fri, 27 Feb 2009, Rainer M Krug wrote: Hi I want to install some versions of R simultaneously from source on a computer (running Linux). Some programs have an option to specify a suffix for the executable (eg R would become

Re: [R] rounding problem

2009-02-27 Thread Peterko
all.equal is what i need, many thanks to help me baptiste auguie-2 wrote: Hi, you probably want to use ?all.equal instead of == I couldn't run your example, though Hope this helps, baptiste On 27 Feb 2009, at 10:32, Peterko wrote: hi i am creating some variables from same

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Gerard M. Keogh
Frank, I can't see the code you mention - Web marshall at work - but I don't think you should be too quick to run down SAS - it's a powerful and flexible language but unfortunately very expensive. Your example mentions doing a vector product in the macro language - this only suggest to me that

Re: [R] bottom legends in ggplot2 ?

2009-02-27 Thread hadley wickham
Yes, this is a known bug which will (hopefully) be addressed in the next release. Hadley On Fri, Feb 27, 2009 at 4:15 AM, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: I would think that the lines below should work but they give an error. Hadley, can you clarify this? Cheers, Thierry

Re: [R] survival::predict.coxph

2009-02-27 Thread Bernhard Reinhardt
Hello Therry, it´s really great to receive some feedback from a pro. I´m not sure if I´ve got the point right: You suppose that the cox-model isn´t good at forecasting an expected survival time because of the issues with the prediction of the survival-function at the right tail and one should

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Ajay ohri
I would like to know if we can create a package in which r functions are renamed closer to sas language.doing so will help people familiar to SAS to straight away take to R for their work,thus decreasing the threshold for acceptance - and then get into deeper understanding later. since it is a

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Barry Rowlingson
2009/2/27 Peter Dalgaard p.dalga...@biostat.ku.dk: Presumably, something like     IF N. =  1 THEN SUB_N = 1;     ELSE IF N. 5 THEN SUB_N = N.-1;     ELSE IF N. 16 THEN SUB_N = N.-2;     ELSE SUB_N = N.-3; would work, provided that 2, 5, 16 are impossible values. Problem is that it

Re: [R] Installing different versions of R simultaneously on Linux

2009-02-27 Thread Rainer M Krug
On Fri, Feb 27, 2009 at 12:37 PM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: This is really an R-devel question. sorry about the wrong list. On Fri, 27 Feb 2009, Rainer M Krug wrote: Hi I want to install some versions of R simultaneously from source on a computer (running Linux).

Re: [R] Installing different versions of R simultaneously on Linux

2009-02-27 Thread Berwin A Turlach
G'day Rainer, On Fri, 27 Feb 2009 10:53:12 +0200 Rainer M Krug r.m.k...@gmail.com wrote: What flavour of Linux are we talking about? Sorry - I am running SuSE on the machine where I need it. Sorry, I am not familiar with that flavour; before switching to Debian (and Debian based

Re: [R] Installing different versions of R simultaneously on Linux

2009-02-27 Thread Rainer M Krug
On Fri, Feb 27, 2009 at 1:49 PM, Berwin A Turlach ber...@maths.uwa.edu.au wrote: G'day Rainer, On Fri, 27 Feb 2009 10:53:12 +0200 Rainer M Krug r.m.k...@gmail.com wrote: What flavour of Linux are we talking about? Sorry - I am running SuSE on the machine where I need it. Sorry, I am not

[R] Advice on graphics to design circle with density-shaded sectors

2009-02-27 Thread John Poulsen
Hello, I am looking for some general advice on which graphics package to use to make a figure demonstrating my experimental design. I want to design a circle with 7 sectors inside. Then I will want to shade the sectors depending on densities of observations in the sectors. I will also

[R] How to get input-data of ROCR

2009-02-27 Thread bioshaw
Hi I have a problem while using the ROCR package in R. I can understand the main three commands, but can't understand the input format, including ROCR.hiv,ROCR.simple and ROCR.xval (actually,not only the format,but also how to get this data)

[R] add absolute value to bars in barplot

2009-02-27 Thread soeren . vogel
Hello, r-h...@r-project.orgbarplot(twcons.area, beside=T, col=c(green4, blue, red3, gray), xlab=estate, ylab=number of persons, ylim=c(0, 110), legend.text=c(treated, mix, untreated, NA)) produces a barplot very fine. In addition, I'd like to get the bars' absolute values on the top

[R] help with correct use of function lsfit

2009-02-27 Thread mauede
To the purpose of fitting a 2nd order polynomial (a + b*x + c*x^2) to the chunk of signal falling in a 17 consecutive samples window I wrote the following very crude script. Since I have no previous experience of using Least Square Fit with R I would appreciate your supervision and suggestion.

Re: [R] Installing different versions of R simultaneously on Linux

2009-02-27 Thread Berwin A Turlach
G'day Rainer, On Fri, 27 Feb 2009 14:06:20 +0200 Rainer M Krug r.m.k...@gmail.com wrote: Thanks a lot for the offer - that would be great. I will set it up the same way on m y PC with Xubuntu. Script is attached. Ignore the comments at the beginning they are there just to remind me what

[R] Sweave doesn't do csv.get()

2009-02-27 Thread christiaan pauw
Hi Everybody I use R2.8.0 on Mac OS X. I set up LyX 1.6.1 to use Sweave today. I can compile the test file I found on CRAN ( http://cran.r-project.org/contrib/extra/lyx/) without a problem and the output looks very nice. In the test file the following R code is used. myFirstChunkInLyX= xObs -

Re: [R] add absolute value to bars in barplot

2009-02-27 Thread Philipp Pagel
On Fri, Feb 27, 2009 at 01:32:45PM +0100, soeren.vo...@eawag.ch wrote: barplot(twcons.area, beside=T, col=c(green4, blue, red3, gray), xlab=estate, ylab=number of persons, ylim=c(0, 110), legend.text=c(treated, mix, untreated, NA)) produces a barplot very fine. In addition, I'd like

Re: [R] Axis-question

2009-02-27 Thread Antje
solved by grouping... (see my next mail) Antje schrieb: Hi there, I was wondering wether it's possible to generate an axis with groups (like in Excel). So that you can have something like this as x-axis (for example for the levelplot-method of the lattice package):

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Frank E Harrell Jr
Wensui Liu wrote: Thanks for pointing me to the SAS code, Dr Harrell After reading codes, I have to say that the inefficiency is not related to SAS language itself but the SAS programmer. An experienced SAS programmer won't use much of hard-coding, very adhoc and difficult to maintain. I agree

[R] levelplot help needed

2009-02-27 Thread Antje
Hi there, I'm looking for someone who can give me some hints how to make a nice levelplot. As an example, I have the following code: # create some example data # -- xl - 4 yl - 10 my.data - sapply(1:xl, FUN = function(x) { rnorm( yl, mean = x) }) x_label

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Frank E Harrell Jr
Ajay ohri wrote: Sometimes for the sake of simplicity, SAS coding is created like that. One can use the concatenate function and drag and drop in an simple excel sheet for creating elaborate SAS code like the one mentioned and without any time at all. A system that requires Excel for its

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Frank E Harrell Jr
Gerard M. Keogh wrote: Frank, I can't see the code you mention - Web marshall at work - but I don't think you should be too quick to run down SAS - it's a powerful and flexible language but unfortunately very expensive. Your example mentions doing a vector product in the macro language - this

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Frank E Harrell Jr
Ajay ohri wrote: I would like to know if we can create a package in which r functions are renamed closer to sas language.doing so will help people familiar to SAS to straight away take to R for their work,thus decreasing the threshold for acceptance - and then get into deeper understanding

[R] Ordinal Mantel-Haenszel type inference

2009-02-27 Thread Jourdan Gold
Hello, I am searching for an R-Package that does an exentsion of the Mantel-Haenszel test for ordinal data as described in Liu and Agresti (1996) A Mantel-Haenszel type inference for cummulative odds ratios. in Biometrics. I see packages such as Epi that perform it for binary data and derives

[R] how can I compare two vector by a factor

2009-02-27 Thread Xin Shi
Hi, I used Wilcox.test to carry out mann whiteney test when paired=false. However, I want to see the comparison of two variables, e.g. pre and post, grouped by treatment. Anyone has this experience? Thanks! Xin [[alternative HTML version deleted]]

Re: [R] Singularity in a regression?

2009-02-27 Thread Alex Roy
If collinearity exists, one of the solutions is regulazation version of regression. There are different types of regularization method. like Ridge, LASSO, elastic net etc. For example, in MASS package you can get ridge regression. Alex On Thu, Feb 26, 2009 at 1:58 PM, Bob Gotwals

Re: [R] question about 3-d plot

2009-02-27 Thread Tony Breyal
Hi Deepankar The code on the following page looks kind of cool, and also seems to produce something of the type of graph you are after perhaps: https://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/pkg/rgl/demo/regression.r?rev=702root=rglsortby=dateview=auto [below is a copy of the code...]

Re: [R] Sweave doesn't do csv.get()

2009-02-27 Thread Frank E Harrell Jr
christiaan pauw wrote: Hi Everybody I use R2.8.0 on Mac OS X. I set up LyX 1.6.1 to use Sweave today. I can compile the test file I found on CRAN ( http://cran.r-project.org/contrib/extra/lyx/) without a problem and the output looks very nice. In the test file the following R code is used.

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Gerard M. Keogh
Yes Frank, I accept your point but nevertheless IML is the proper place for matrix work in SAS - mixing macro-level logic and computation is another question - R is certainly more seemless in this respect. Gerard

[R] Will ctv package work on ubuntu?

2009-02-27 Thread Brian Lunergan
Hi ho: I had used the ctv package on a Windows setup of R and I was wondering about Ubuntu. Certainly under Windows it has an easy time of it because there is only one library folder to scan for existing packages. Would its install.views and update.views functions work in Ubuntu where the

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Marc Schwartz
on 02/27/2009 07:57 AM Frank E Harrell Jr wrote: Ajay ohri wrote: I would like to know if we can create a package in which r functions are renamed closer to sas language.doing so will help people familiar to SAS to straight away take to R for their work,thus decreasing the threshold for

Re: [R] Download daily weather data

2009-02-27 Thread Thomas Levine
Geonames unfortunately doesn't have weather forecasts. This is a problem. GRIB looks better. There is an interface between GRIB and R. On Fri, Feb 27, 2009 at 4:14 AM, Pfaff, Bernhard Dr. bernhard_pf...@fra.invesco.com wrote: Dear Thomas, more for the sake of completeness and as an

Re: [R] Sweave doesn't do csv.get()

2009-02-27 Thread christiaan pauw
It works now. Your help is much appreciated Christiaan 2009/2/27 Frank E Harrell Jr f.harr...@vanderbilt.edu christiaan pauw wrote: Hi Everybody I use R2.8.0 on Mac OS X. I set up LyX 1.6.1 to use Sweave today. I can compile the test file I found on CRAN (

Re: [R] Download daily weather data

2009-02-27 Thread James Muller
Can I just say, it's great to see the R community really come out in support of such a noble and worthy cause as this :). Downfall of civilization, all that. Not here, no! James On Thu, Feb 26, 2009 at 3:47 PM, Thomas Levine thomas.lev...@gmail.com wrote: I'm writing a program that will tell

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread spam me
I've actually used AHRQ's software to create Inpatient Quality Indicator reports. I can confirm pretty much what we already know; it is inefficient. Running on about 1.8 - 2 million cases, it would take just about a whole day to run the entire process from start to finish. That isn't all

Re: [R] ftp fetch using RCurl?

2009-02-27 Thread CHD850
I am using RCurl, version 0.9-4, under windows. I can not find the function getURLContent(). Is it being renamed ? or is it in a different version? Also, in the reference manual on CRAN R under package RCurl, I found a function getBinaryURL() documented but can not be found in the package as

[R] cross tabulation: convert frequencies to percentages

2009-02-27 Thread soeren . vogel
Hello, might be rather easy for R pros, but I've been searching to the dead end to ... twsource.area - table(twsource, area, useNA=ifany) gives me a nice cross tabulation of frequencies of two factors, but now I want to convert to pecentages of those absolute values. In addition I'd

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Thomas Levine
I had enrolled in a statistics course this semester, but after the first class, I dropped it because it uses SAS. This thread makes me quite glad. Tom! On Fri, Feb 27, 2009 at 8:48 AM, Frank E Harrell Jr f.harr...@vanderbilt.edu wrote: Wensui Liu wrote: Thanks for pointing me to the SAS code,

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Ajay ohri
Immersion therapy can be done at a later stage after the newly baptized R corporate user is happy with the fact that he can do most of his legacy code in R easily now . I have treading water in the immersion for over a year now. Most SAS consultants and corporate users are eager to try out R

[R] Making tapply code more efficient

2009-02-27 Thread Doran, Harold
Previously, I posed the question pasted down below to the list and received some very helpful responses. While the code suggestions provided in response indeed work, they seem to only work with *very* small data sets and so I wanted to follow up and see if anyone had ideas for better efficiency. I

[R] Setting initial starting conditions in scripts

2009-02-27 Thread Steve_Friedman
Hello, I'm writing a variety of R scripts and want to code the loadhistory and workspace from within the script. I found the loadhistory function but do not see a comparable function for load workspace. Is there one ? Working with R 2.8.1 (2008-12-22) on a windows platform. Thanks for any

[R] Adjusting confidence intervals for paired t-tests of multiple endpoints

2009-02-27 Thread Erich Studerus
Dear R-users, In a randomized placebo-controlled within-subject design, subjects recieved a psycho-active drug and placebo. Subjects filled out a questionnaire containing 15 scales on four different time points after drug administration. In order to detect drug effects on each time point, I

[R] Changing Ylab and scale in hclust plots

2009-02-27 Thread Steve_Friedman
Hello, Running R 2.8.1 (2008-12-22) on Windows. I running a series (25) of clustering procedures using the hclust function and would like each of the plots to have the same yaxis label and scale in all of the plots. Is there a procedure to change the scale on these plots? Or is there an

Re: [R] cross tabulation: convert frequencies to percentages

2009-02-27 Thread Marc Schwartz
on 02/27/2009 08:43 AM soeren.vo...@eawag.ch wrote: Hello, might be rather easy for R pros, but I've been searching to the dead end to ... twsource.area - table(twsource, area, useNA=ifany) gives me a nice cross tabulation of frequencies of two factors, but now I want to convert to

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Frank E Harrell Jr
Ajay ohri wrote: Immersion therapy can be done at a later stage after the newly baptized R corporate user is happy with the fact that he can do most of his legacy code in R easily now . I have treading water in the immersion for over a year now. Most SAS consultants and corporate users

Re: [R] Making tapply code more efficient

2009-02-27 Thread ONKELINX, Thierry
Hi Harold, What about this? You one have to make the crosstabulation once. qq - data.frame(student = factor(c(1,1,2,2,2)), teacher = factor(c(10,10,20,20,25))) tab - table(qq$student, qq$teacher) data.frame(Student = rownames(tab), Freq = rowSums(tab), tch = rowSums(tab 0) == 1) Student

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Terry Therneau
Three comments I actually think you can write worse code in R than in SAS: more tools = more scope for innovatively bad ideas. The ability to write bad code should not damm a language. I found almost all of the improvements to the multi-line SAS recode to be regressions, both the SAS

Re: [R] Ordinal Mantel-Haenszel type inference

2009-02-27 Thread David Winsemius
I suspect that what you need will be in S-PLUS (and R) Manual to Accompany Agresti’s Categorical Data Analysis (2002) 2nd edition by Laura A. Thompson, 2007 which I have always been able to find with a Google search. Yep, it's still there:

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Frank E Harrell Jr
Terry Therneau wrote: Three comments I actually think you can write worse code in R than in SAS: more tools = more scope for innovatively bad ideas. The ability to write bad code should not damm a language. I found almost all of the improvements to the multi-line SAS recode to be

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread John Sorkin
Terry's remarks (see below) are well received however, I take issue with one part of his comments. As a long time programmer (in both statistical programming languages and traditional programming languages), I miss the ability to write native-languages in R. While macros can make for difficult

[R] R crash on Mac

2009-02-27 Thread Adelchi Azzalini
If I define this function R ask - function (message = Type in datum) eval(parse(prompt = paste(message, : , sep = ))) the following is produced as expected on a Linux/debian machine R ask(input) input: 3 [1] 3 R ask(input) input: 3:6 [1] 3 4 5 6 R ask(input) input: c(3,6) [1]

[R] formula formatting/grammar for regression

2009-02-27 Thread Brigid Mooney
Hi all, I am doing some basic regression analysis, and am getting a bit confused on how to enter non-polynomial formulas to be used. For example, consider that I want to find A and r such that the formula y = A*exp(r*x) provides the the best fit to the line y=x on the interval [0,50]. I can

Re: [R] formula formatting/grammar for regression

2009-02-27 Thread Dieter Menne
Brigid Mooney bkmooney at gmail.com writes: I am doing some basic regression analysis, and am getting a bit confused on how to enter non-polynomial formulas to be used. .. But am confused on what the formula should be for trying to find a fit to y = A*exp(r*x). If this example is just a

[R] [R-pkgs] Package DAKS for knowledge space theory, on CRAN now

2009-02-27 Thread Ali Uenlue
Version 1.0-0 of DAKS (Data Analysis and Knowledge Spaces) has been released to CRAN. Knowledge space theory is a recent psychometric test theory based on combinatorial mathematical structures (order and lattice theory). Solvability dependencies between dichotomous test items play an

Re: [R] Using package ROCR

2009-02-27 Thread Uwe Ligges
For question 1: Can you please report to the package maintainer (well, I am CCing Tobias now) who will certainly be happy to improve the package (particularly the demo behaviour). For question 2 (and your latest message): does not happen for me. Which versions are you using, i.e. have you

Re: [R] levelplot help needed

2009-02-27 Thread Sundar Dorai-Raj
To reorder the y-labels, simply reorder the factor levels: df - data.frame(x_label = factor(x_label), y_label = factor(y_label, rev(y_label)), values = as.vector(my.data)) Not sure about putting the strips at the bottom. A quick scan of ?xyplot and

Re: [R] combining identify() and locator()

2009-02-27 Thread Brian Bolt
awesome. Thank you very much for the quick response. I think this is exactly what I was looking for. -Brian On Feb 27, 2009, at 1:10 AM, Barry Rowlingson wrote: 2009/2/27 Brian Bolt bb...@kalypsys.com: Hi, I am wondering if there might be a way to combine the two functions identify() and

Re: [R] levelplot help needed

2009-02-27 Thread David Winsemius
Try using the alternating=FALSE option. -- David Winsemius On Feb 27, 2009, at 12:07 PM, Sundar Dorai-Raj wrote: To reorder the y-labels, simply reorder the factor levels: df - data.frame(x_label = factor(x_label), y_label = factor(y_label, rev(y_label)),

Re: [R] Re : Have a function like the _n_ in R ? (Automatic count function )

2009-02-27 Thread Johannes Hüsing
If you are in the context of a data frame (which is closest to the concept of a data set in SAS), the 1:nrow(df) is closest to what you may look for. For instance: data(iris) .n. - 1:nrow(iris) You may notice that this number is not very idiomatic in R. If you have something like: if(_N_

[R] Filtering a dataset's columns by another dataset's column names

2009-02-27 Thread Josh B
Hello all, I hope some of you can come to my rescue, yet again. I have two genetic datasets, and I want one of the datasets to have only the columns that are in common with the other dataset. Here is a toy example (my real datasets have hundreds of columns): Dataset 1: IndividualSNP1

Re: [R] Filtering a dataset's columns by another dataset's column names

2009-02-27 Thread Rowe, Brian Lee Yung (Portfolio Analytics)
Try this: d1[,intersect(names(d1),names(d2))] HTH, Brian -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Josh B Sent: Friday, February 27, 2009 12:28 PM To: R Help Subject: [R] Filtering a dataset's columns by another dataset's

Re: [R] Filtering a dataset's columns by another dataset's column names

2009-02-27 Thread Marc Schwartz
on 02/27/2009 11:27 AM Josh B wrote: Hello all, I hope some of you can come to my rescue, yet again. I have two genetic datasets, and I want one of the datasets to have only the columns that are in common with the other dataset. Here is a toy example (my real datasets have hundreds of

Re: [R] Filtering a dataset's columns by another dataset's column names

2009-02-27 Thread Jorge Ivan Velez
Dear Josh, Try this: dataset1[,colnames(dataset1) %in% colnames(dataset2)] Take a look at ?colnames and ?%in% for more information. HTH, Jorge On Fri, Feb 27, 2009 at 12:27 PM, Josh B josh...@yahoo.com wrote: Hello all, I hope some of you can come to my rescue, yet again. I have two

Re: [R] Filtering a dataset's columns by another dataset's column names

2009-02-27 Thread David Winsemius
So you want the data that is in Dataset 1 but only the column names that are also in Dataset 2: How about: subset(DS1, select = names(DS1) %in% names(DS2) ) DS1 -read.table(textConnection(IndividualSNP1SNP2 SNP3SNP4SNP5 + 1AGTCA + 2TCA

Re: [R] combining identify() and locator()

2009-02-27 Thread Barry Rowlingson
2009/2/27 Brian Bolt bb...@kalypsys.com: awesome.  Thank you very much for the quick response. I think this is exactly what I was looking for. Here's a basic framework: `idloc` - function(xy,n=1, tol=0.25){ tol2=tol^2 icoords =

Re: [R] Filtering a dataset's columns by another dataset's column names

2009-02-27 Thread Daniel Malter
Hi Josh B, this looks like homework to me. Please obey the posting rules. I.e., provide self-contained code/examples and show what the point is at which you are stuck. To solve your problem, you need the which and the names function as well as the %in% operator. It is then easy to rbind the

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Frank E Harrell Jr
spam me wrote: I've actually used AHRQ's software to create Inpatient Quality Indicator reports. I can confirm pretty much what we already know; it is inefficient. Running on about 1.8 - 2 million cases, it would take just about a whole day to run the entire process from start to finish. That

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Frank E Harrell Jr
John Sorkin wrote: Terry's remarks (see below) are well received however, I take issue with one part of his comments. As a long time programmer (in both statistical programming languages and traditional programming languages), I miss the ability to write native-languages in R. While macros

[R] help with projection pursuit

2009-02-27 Thread Olivier MARTIN
Hi all, I have some difficulties with the function ppr for projection pursuit regression. I obtained the results for a projection pursuit regression and now I would like to compute some predictions for new data. I tried the function predict in the following way predict(res.ppr, newdata) but

[R] Help: locfit (local logistic regression)

2009-02-27 Thread Sharai Gomez
Hi, I am running a local logistic regression using locfit. Now, I want to choose the bandwidth using cross-validation. I don't know if there is an additional command to do so or if I can do it in the locfit. I would appreciate any help about this matter. Thank you. Regards,

Re: [R] add absolute value to bars in barplot

2009-02-27 Thread Greg Snow
Note that putting numbers near the top of the bars (either inside or outside) tends to create 'fuzzy' tops to the bars that make it harder for the viewer to quickly interpret the graph. If the numbers are important, put them in a table. If you really need to have the numbers and graph

[R] [R-pkgs] mefa 3.0-0

2009-02-27 Thread Peter Solymos
Dear R Community, I am pleased to announce that a new version of the mefa R package is available at the CRAN. mefa is a package for multivariate data handling in ecology and biogeography. It provides object classes to represent the data coded by samples, taxa and segments (i.e., subpopulations,

[R] testing two-factor anova effects using model comparison approach with lm() and anova()

2009-02-27 Thread Paul Gribble
I wonder if someone could explain the behavior of the anova() and lm() functions in the following situation: I have a standard 3x2 factorial design, factorA has 3 levels, factorB has 2 levels, they are fully crossed. I have a dependent variable DV. Of course I can do the following to get the

Re: [R] formula formatting/grammar for regression

2009-02-27 Thread BKMooney
This is just (or should be) just a simple example of what I would like to extend to further regression - which is why I was looking for a resource on the grammar. If I try: lm(ypts ~ exp(xpts)), I only get an intercept and one coefficient. And for the coefficient, I am not sure where that

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Ajay ohri
A further example of software pricing dynamics is the complete lack of awareness of WPS , a UK based software which is basically a base SAS clone with all the features of SAS ( coding read ,write and data read /write) and priced only at 660$ per desktop and 1400$ for server licenses ..very very

Re: [R] help with projection pursuit

2009-02-27 Thread David Winsemius
In my experience (and per the help pages now that I look) the predict functions need named arguments that match up with the column names in the model and generally this needs to be supplied as a dataframe or a list. (note: at least on my machine the rock dataframe does *not* have the

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread John Sorkin
Frank, A programming language's efficience is a function of several items, including what you are trying to program. Without using SAS proc IML, I have found that it is more efficient to code algorithms (e.g. a least squares linear regression) using R than SAS; we all know that matrix notation

Re: [R] testing two-factor anova effects using model comparison approach with lm() and anova()

2009-02-27 Thread Greg Snow
Notice the degrees of freedom as well in the different models. With factors A and B, the 2 models: A + B + A:B And A + A:B Are actually the same overall model, just different parameterizations (you can also see this by using x=TRUE in the call to lm and looking at the x matrix used).

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Bryan
My apologies, this obviously doubles as my for registration purposes account and so I don't often send from it - I was not intentionally being so secretive : ) At any rate, I completely agree, but of course it's a reciprocal relationship. The software is written in SAS because that's what the

Re: [R] Inefficiency of SAS Programming

2009-02-27 Thread Chu, Roy
Also because no one wants to put their neck out on a chopping block to suggest R without technical support and the like. If you use SAS, there's a cascade of blame available, but it's not immediately available for R. On Fri, Feb 27, 2009 at 10:36 AM, Bryan thespamho...@gmail.com wrote: My

[R] select Intercept coefficients only

2009-02-27 Thread choonhong ang
Hi friends, Is there a function to select intercept coefficients only ? When I use coeficients it shows me all the coefficients, but I only want a specific coefficients. [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] Making tapply code more efficient

2009-02-27 Thread jim holtman
On something the size of your data it took about 30 seconds to determine the number of unique teachers per student. x - cbind(sample(326397, 800967, TRUE), sample(20, 800967, TRUE)) # split the data so you have the number of teachers per student system.time(t.s - split(x[,2], x[,1])) user

Re: [R] select Intercept coefficients only

2009-02-27 Thread Uwe Ligges
choonhong ang wrote: Hi friends, Is there a function to select intercept coefficients only ? When I use coeficients it shows me all the coefficients, but I only want a specific coefficients. What about indexing, e.g. as in: coefficients(some_lm_object)[(Intercept)] Uwe Ligges

  1   2   >