Re: [R] panel.first problem when plotting with formula

2011-05-25 Thread Gene Leynes
Peter, Good idea! (why didn't I think of that?) If it stumped the r-list, I think there is probably a slight bug with the plot formula. Problems like this make me realize how amazingly full featured and relatively bug free R is. A problem like this would never happen in Excel, because this

[R] plotting texas school district using shape files

2011-05-25 Thread Shant Ch
Hi, I was plotting or creating a map for Texas school districts using the shape file of Texas. I could not find any other helpful mail in the mailing list. txshp-read.shape(system.file(S:\\Districts_10_11.shp, package=maptools)) Error- read.shape no found. But read.shape is there in

[R] Processing large datasets

2011-05-25 Thread Roman Naumenko
Hi R list, I'm new to R software, so I'd like to ask about it is capabilities. What I'm looking to do is to run some statistical tests on quite big tables which are aggregated quotes from a market feed. This is a typical set of data. Each day contains millions of records (up to 10 non

Re: [R] How to call an external program/web page under R for Mac OS?

2011-05-25 Thread Paul Hiemstra
On 05/24/2011 10:56 PM, jbrezmes wrote: I would like to be able to call external programs such as Java scripts (*.jar files) or bring up the browser to a given direction. Can that be done from R? I am running R on a mac OS X system. Thanks again for any suggestions or solutions. Best

[R] questions about rpart

2011-05-25 Thread carol white
Hi, I have applied rpart to my data set and for cp=.01, the cross-validation error (xerr) is less (min 0.05) than for other cp. However, in the final tree, an important predictor is not retained. Moreover, another predictor contains missing values in 40% of samples. So I don't know if the

Re: [R] plotting single variables common to multiple data frames

2011-05-25 Thread Mathew Brown
Hi John, First off, thanks again for your help with this. Much appreciated. I've attached a file of the original data (yes, as you can see there are header names). These hour long files are zipped together on a computer (which is actually an analyzer) and sent each morning to a server. I then

Re: [R] Count of rows while looping through data

2011-05-25 Thread Kenn Konstabel
An alternative approach would be to `split` the data frame by family, then `lapply` a function selecting random row from each slice, and then `rbind` it all together. x = data.frame(family = rep(1:20,sample(2:5,20,replace=TRUE)), xyz=1) randomrow - function(x) x[sample(1:nrow(x),1),] # step by

[R] help with tune.svm() e1071

2011-05-25 Thread Salih Tuna
Hi, I am trying to use tune.svm in e1071 package. the command i use is tobj - tune.svm(labels, data= data, cost = 10^(1:2)) Should the last column of the 'data' contain the labels as well? I want to use the linear kernel. But it gives me the error Error in model.frame.default(formula, data) :

[R] Fw: questions about rpart - cont.

2011-05-25 Thread carol white
Forgot to specify that the cross-val error cannot be decreased lower than 0.91. Note that for smaller values of cp than 0.01, the cross-val error increases. Is the cross-val error sum of squared error or relative error for classification problem (method = class in rpart function) or another

Re: [R] RGL package installation problem on Centos

2011-05-25 Thread john herbert
Hi. Thank you for your help. From your suggestions, I tried the following; R CMD INSTALL --no-test-load rgl_0.92.798.tar.gz This seemed to load and install (starting R and issuing library(rgl) did not flag any problems But running the sphere example from rgl, it causes big problems :-) # R R

Re: [R] RGL package installation problem on Centos

2011-05-25 Thread Duncan Murdoch
On 11-05-25 6:08 AM, john herbert wrote: Hi. Thank you for your help. From your suggestions, I tried the following; R CMD INSTALL --no-test-load rgl_0.92.798.tar.gz This seemed to load and install (starting R and issuing library(rgl) did not flag any problems But running the sphere example

Re: [R] plotting texas school district using shape files

2011-05-25 Thread Ben Bolker
Shant Ch sha1one at yahoo.com writes: Hi, I was plotting or creating a map for Texas school districts using the shape file of Texas. I could not find any other helpful mail in the mailing list. txshp-read.shape(system.file(S:\\Districts_10_11.shp, package=maptools)) Error-

Re: [R] Thiessen method

2011-05-25 Thread Ben Bolker
federico.eccel federico.eccel at gmail.com writes: I try to search in the web and in the R forum for any package for computing The thiessen method but I didn't find anything. I would like to ask if it exists any package in R that provides the possiblity to compute the Thiessen method for

Re: [R] Processing large datasets

2011-05-25 Thread Jonathan Daily
In cases where I have to parse through large datasets that will not fit into R's memory, I will grab relevant data using SQL and then analyze said data using R. There are several packages designed to do this, like [1] and [2] below, that allow you to query a database using SQL and end up with that

[R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread Victor Gabillon
Hello, I want to use the function barplot do display several group of bars. A standard example is given at this link http://onertipaday.blogspot.com/2007/05/make-many-barplot-into-one-plot.html But in their example the 4 groups of bars are all composed of 8 bars. I want to be able do display

Re: [R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread ONKELINX, Thierry
Dear Victor, Here is a basic solutions using ggplot2 library(ggplot2) dataset - data.frame(Main = c(A, A, A, B, B), Detail = c(a, b, c, 1, 2), value = runif(5, min = 0.5, max = 1)) ggplot(dataset, aes(x = Detail, y = value)) + geom_bar() + facet_grid(.~Main, scales = free_x) Best regards,

Re: [R] help with tune.svm() e1071

2011-05-25 Thread Steve Lianoglou
Hi, On Wed, May 25, 2011 at 4:54 AM, Salih Tuna saliht...@gmail.com wrote: Hi, I am trying to use tune.svm in e1071 package. the command i use is tobj - tune.svm(labels, data= data, cost = 10^(1:2)) The first few arguments from the method signature for tune.svm is: tune.svm(x, y = NULL,

Re: [R] Processing large datasets

2011-05-25 Thread Steve Lianoglou
Hi, On Wed, May 25, 2011 at 12:29 AM, Roman Naumenko ro...@bestroman.com wrote: Hi R list, I'm new to R software, so I'd like to ask about it is capabilities. What I'm looking to do is to run some statistical tests on quite big tables which are aggregated quotes from a market feed. This is

[R] transpose ?

2011-05-25 Thread Mohamed Lajnef
Dear All, Suppose this data.frame D V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21 V22 C C C C T T G G A A C C G G C C G G T T A A A A T A T T C C G G C C C C T T G G A A C C G G C C I would translate

Re: [R] transpose ?

2011-05-25 Thread Scott Chamberlain
See ?t __Scott Chamberlain Rice University, EEB Dept. On Wednesday, May 25, 2011 at 9:07 AM, Mohamed Lajnef wrote: Dear All, Suppose this data.frame D V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21 V22 C C C C T T G G A A C C G G C C G G T T A A A A T A T T

[R] Fwd: transpose ?

2011-05-25 Thread Mohamed Lajnef
Dear All, Sorry for the previous mail,suppose this data.frame D V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21 V22 C C C C T T G G A A C C G G C C G G T T A A A A T A T T C C G G C C C C T T G G A A C C G G

[R] issues with rJava; cannot run JRI example

2011-05-25 Thread Ajaya Mishra
Hello, I am trying to run JRI example from rJava, but I have some issues. I have read many posts and didn't find any solution to my problem. I have the following code: Rengine re = new Rengine(null, false, null); System.out.println(Rengine created, waiting for R); if (!re.waitForR())

[R] Print the content of several columns in only one

2011-05-25 Thread zoe.cryocla
Hi, I’m an R beginner and I'd really appreciate an hand… I'd like to create a new column in a dataframe in wich will be print the content of several other columns. For instance : I’ve got 2 columns : site – sampling number and I would like to create a third column ID, in wich will appear both

[R] select levels of factor variables

2011-05-25 Thread zoe.cryocla
Hi again, I've got another question... I often use the symbol == to select some levels of factor variables like : data[data$var==blabla, [ But this time, I'd like to select all the levels of my variable wich contain the letter B, is that a way to determine this conditions ? Thanks a lot ! Zoé

[R] approximate function and find local peaks (Maxima or Minima)

2011-05-25 Thread Michael S.
Hi, I have a data-matrix: CB                    Zeit                Low 2   2011-05-02 08:05:05 7596.0 3   2011-05-02 08:10:06 7593.5 4   2011-05-02 08:15:11 7594.5 5   2011-05-02 08:20:15 7597.5 6   2011-05-02 08:25:18 7595.0 7   2011-05-02 08:30:20

[R] combined odds ratio

2011-05-25 Thread linda Porz
Dear all, I am looking for an R function which does stepwise selection cox model in r (delta chisq likelihood ratio test) similar to the stepwise, pe (0.05) lr: stcox in STATA. I am very thankful for any reply. Regards, Linda [[alternative HTML version deleted]]

[R] stepwise selection cox model

2011-05-25 Thread linda Porz
Sorry, I have wrote a wrong subject in the first email! Regards, Linda -- Forwarded message -- From: linda Porz linda.p...@gmail.com Date: 2011/5/25 Subject: combined odds ratio To: r-help@r-project.org Cc: r-help-requ...@stat.math.ethz.ch Dear all, I am looking for an R

[R] connection problem

2011-05-25 Thread rgui
Hi, I have a problem during choosing a Cran mirror, an error messages comes: In open.connection (con, r) connection to 'cran.r-project.org' impossible to prt 80. I don't know why? can you help me to choose a cran mirror. thanks for any suggestion. -- View this message in context:

[R] What does smaller than comparison do on strings?

2011-05-25 Thread Niklaus Kuehnis
What's the logic behind the following, and where can I find any documentation about it? In particular, why are 2:9 - as characters - not regarded as being smaller than 10? # R-Code: a - as.character(1:12) a 10 # [1] TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE

Re: [R] Print the content of several columns in only one

2011-05-25 Thread zoe.cryocla
Ok, I found how to do, with the function paste() -- View this message in context: http://r.789695.n4.nabble.com/Print-the-content-of-several-columns-in-only-one-tp3549114p3549514.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] R as.numeric()

2011-05-25 Thread Lutz Fischer
Thanks a lot for both replies. If I setup the option as proposed everything works as I wanted it to. I guess as.character would work as well. Only then I guess I would need to loop through the data frame. Lutz On 24/05/11 22:42, Ista Zahn wrote: This is a FAQ:

Re: [R] Multinomial Logistical Model

2011-05-25 Thread Mark Difford
On May 24, 2011; 11:06pm Belle wrote: Does anyone know how to run Multinomial logistical Model in R in order to get predicted probability? Yes. I could stop there but you shouldn't. The author of the package provides plenty of examples (and two good vignettes) showing you how to do this.

[R] Adjusted Rate Ratios in R

2011-05-25 Thread matthew.benigni
I am trying to calculate Poisson regression based adjusted rate ratios in R, but R's default in glm does not code the intercept as the global rate. In SAS I use cell means coding so that the intercept is the global rate, but I do not know how to do this in R. If anyone knows a way to make glm

Re: [R] plotting texas school district using shape files

2011-05-25 Thread Shant Ch
Yes I had included the library(maptools) in my code, it is already installed in my computer. but still it is showing the same error. From: Ben Bolker bbol...@gmail.com To: r-h...@stat.math.ethz.ch Sent: Wed, May 25, 2011 8:06:19 AM Subject: Re: [R] plotting

Re: [R] Processing large datasets

2011-05-25 Thread Roman Naumenko
Thanks Jonathan. I'm already using RMySQL to load data for couple of days. I wanted to know what are the relevant R capabilities if I want to process much bigger tables. R always reads the whole set into memory and this might be a limitation in case of big tables, correct? Doesn't it use

Re: [R] Processing large datasets

2011-05-25 Thread Roman Naumenko
Hi, On Wed, May 25, 2011 at 12:29 AM, Roman Naumenko ro...@bestroman.com wrote: Hi R list, I'm new to R software, so I'd like to ask about it is capabilities. What I'm looking to do is to run some statistical tests on quite big tables which are aggregated quotes from a market feed.

Re: [R] Fwd: transpose ?

2011-05-25 Thread Jeff Newmiller
Then use as.matrix. Transpose is not a well-defined operation for data frames. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research

Re: [R] panel.first problem when plotting with formula

2011-05-25 Thread David Winsemius
On May 24, 2011, at 11:42 PM, Gene Leynes wrote: Peter, Good idea! (why didn't I think of that?) If it stumped the r-list, I think there is probably a slight bug with the plot formula. Problems like this make me realize how amazingly full featured and relatively bug free R is. A

Re: [R] What does smaller than comparison do on strings?

2011-05-25 Thread Duncan Murdoch
On 25/05/2011 6:06 AM, Niklaus Kuehnis wrote: What's the logic behind the following, and where can I find any documentation about it? In particular, why are 2:9 - as characters - not regarded as being smaller than 10? # R-Code: a- as.character(1:12) a 10 # [1] TRUE FALSE FALSE FALSE FALSE

Re: [R] Processing large datasets

2011-05-25 Thread Marc Schwartz
Take a look at the High-Performance and Parallel Computing with R CRAN Task View: http://cran.us.r-project.org/web/views/HighPerformanceComputing.html specifically at the section labeled Large memory and out-of-memory data. There are some specific R features that have been implemented in a

Re: [R] select levels of factor variables

2011-05-25 Thread David Winsemius
On May 25, 2011, at 4:46 AM, zoe.cryocla wrote: Hi again, I've got another question... I often use the symbol == to select some levels of factor variables like : data[data$var==blabla, [ But this time, I'd like to select all the levels of my variable wich contain the letter B, is that

Re: [R] Processing large datasets

2011-05-25 Thread Steve Lianoglou
Hi, On Wed, May 25, 2011 at 10:18 AM, Roman Naumenko ro...@bestroman.com wrote: [snip] I don't think data.table is fundamentally different from data.frame type, but thanks for the suggestion. http://cran.r-project.org/web/packages/data.table/vignettes/datatable-intro.pdf Just like

Re: [R] Processing large datasets/ non answer but Q on writing data frame derivative.

2011-05-25 Thread Mike Marchywka
Date: Wed, 25 May 2011 09:49:00 -0400 From: ro...@bestroman.com To: biomathjda...@gmail.com CC: r-help@r-project.org Subject: Re: [R] Processing large datasets Thanks Jonathan. I'm already using RMySQL to load data for couple of days. I

Re: [R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread Marc Schwartz
On May 25, 2011, at 7:56 AM, Victor Gabillon wrote: Hello, I want to use the function barplot do display several group of bars. A standard example is given at this link http://onertipaday.blogspot.com/2007/05/make-many-barplot-into-one-plot.html But in their example the 4 groups of bars

Re: [R] plotting texas school district using shape files

2011-05-25 Thread Ben Bolker
Shant Ch sha1one at yahoo.com writes: Yes I had included the library(maptools) in my code, it is already installed in my computer. but still it is showing the same error. In that case you should (1) read the posting guide, (2) copy and paste the code you ran, and the precise error you

Re: [R] Multinomial Logistical Model

2011-05-25 Thread Frank Harrell
I suggest a couple of courses before proceeding. Multinomial logistic models have special challenges. And note that you have two nomenclature errors in your note, which is usually a sign of not having taken the relevant coursework. Frank Belle wrote: Does anyone know how to run Multinomial

[R] the mgcv package can not be loaded

2011-05-25 Thread gbrenes
Hi. I have been trying to load the mgcv package but I always get the error message: there is no package called 'nlme' Error: package/namespace load failed for 'mgcv' I load the package nlme and still I get the same message. I have noticed that there are some problems in using nlme in recent

Re: [R] stepwise selection cox model

2011-05-25 Thread David Winsemius
On May 25, 2011, at 5:28 AM, linda Porz wrote: Sorry, I have wrote a wrong subject in the first email! Regards, Linda -- Forwarded message -- From: linda Porz linda.p...@gmail.com Date: 2011/5/25 Subject: combined odds ratio To: r-help@r-project.org Cc:

Re: [R] R as.numeric()

2011-05-25 Thread David Winsemius
On May 25, 2011, at 7:25 AM, Lutz Fischer wrote: Thanks a lot for both replies. If I setup the option as proposed everything works as I wanted it to. I guess as.character would work as well. Only then I guess I would need to loop through the data frame. as.character is vectorized. You

Re: [R] the mgcv package can not be loaded

2011-05-25 Thread Sarah Goslee
We really need some more information to be able to help you (as requested in the posting guide): What OS? What version of R? How did you install nlme? Were there any messages? What happens when you type library(nlme) at the R prompt? How did you install mgcv? Were there any messages? On Wed,

Re: [R] Print the content of several columns in only one

2011-05-25 Thread Scott Chamberlain
Or use melt in the reshape2 package to melt all columns to one with an indexing column to boot... __Scott Chamberlain Rice University, EEB Dept. On Wednesday, May 25, 2011 at 7:06 AM, zoe.cryocla wrote: Ok, I found how to do, with the function paste() -- View this

Re: [R] Processing large datasets

2011-05-25 Thread Mike Marchywka
Date: Wed, 25 May 2011 10:18:48 -0400 From: ro...@bestroman.com To: mailinglist.honey...@gmail.com CC: r-help@r-project.org Subject: Re: [R] Processing large datasets Hi, If your datasets are *really* huge, check out some packages listed

Re: [R] stepwise selection cox model

2011-05-25 Thread Marc Schwartz
Hi, You are unlikely to find one, as fundamentally, stepwise procedures are a bad way to engage in covariate selection. Search the list archives at rseek.org using 'stepwise' as the keyword to see a plethora of discussion on this point. This is not a new issue BTW, as I happened to stumble

[R] Importing fixed-width data

2011-05-25 Thread James Rome
I have a data set where the lines look like: 2011-05-13 00:00:00 EONAAL330 dfa13002516PSCNONA 2011-05-13 00:00:01 EONAAL223 laa13044510AS.NONM Some lines are missing the field before and after the NON: 2011-05-13 00:00:05 EONBHS229 mia13001621NON I read them into R using df = read.fwf(file,

Re: [R] Importing fixed-width data

2011-05-25 Thread Ian Gow
Everything looks OK. Does this help? test - data.frame(alpha=as.factor(c(A,A,B,B,C)),number=c(1,2,3,4,5)) mode(test) [1] list class(test) [1] data.frame sapply(test, mode) alphanumber numeric numeric sapply(test, class) alphanumber factor numeric On 5/25/11 10:42 AM,

Re: [R] stepwise selection cox model

2011-05-25 Thread Bert Gunter
See the Vignette in the glmnet package for one alternative approach to variable selection. Of course, you need to gain some background to know what you're doing here. -- Bert On Wed, May 25, 2011 at 8:38 AM, Marc Schwartz marc_schwa...@me.com wrote: Hi, You are unlikely to find one, as

Re: [R] Processing large datasets

2011-05-25 Thread Hugo Mildenberger
With PostgreSQL at least, R can also be used as implementation language for stored procedures. Hence data transfers between processes can be avoided alltogether. http://www.joeconway.com/plr/ Implemention of such a procedure in R appears to be straighforward: CREATE OR REPLACE FUNCTION

[R] Trouble Combining With Paste

2011-05-25 Thread Sparks, John James
Dear R Helpers, I am having trouble combining some pieces of programming that work fine individually, but fall down when I try to get them to work together. The end goal is to take a data frame, and if any of the variables has more than 10 values, then use cut2 to reduce the number of

Re: [R] the mgcv package can not be loaded

2011-05-25 Thread Sarah Goslee
Well, that answered some of my questions, though you forgot to send your answer to the r-help list rather than just to me. I don't use windows, so someone else may have better advice. On Wed, May 25, 2011 at 12:02 PM, gbre...@ssc.wisc.edu wrote: Sorry, I forgot to be more specific. I am using

Re: [R] Trouble Combining With Paste

2011-05-25 Thread Joshua Wiley
Hi John, The issue is that: infert$age != infert$age One is a text string, the other references the information stored in the age variable of the infert object. If you need to pass the names as a string, use [ instead: ## for a data frame infert[, age] ## for a list infert[[age]] It looks

Re: [R] Trouble Combining With Paste

2011-05-25 Thread Sarah Goslee
You need to use get() so that you are acting on the dataframe, and not the string that names the dataframe. Sarah On Wed, May 25, 2011 at 12:02 PM, Sparks, John James jspa...@uic.edu wrote: Dear R Helpers, I am having trouble combining some pieces of programming that work fine individually,

Re: [R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread Walmes Zeviani
Victor, I agree with Marc's point of view. So, if you can use another representation of you data, like points, considering looking at http://lmdvr.r-forge.r-project.org/figures/figures.html figures 10.20 and 10.21 for a start point. Walmes.

[R] [Fwd: Re: the mgcv package can not be loaded]

2011-05-25 Thread gbrenes
Sorry, I forgot to be more specific. I am using Windows XP. I am using R.12.2 I installed both packages from the install packages menu. I always write library(name.of.library), and it is enough. But when I write library(nlme), R does not find nlme right away I load nlme first and it says

Re: [R] Trouble Combining With Paste

2011-05-25 Thread Phil Spector
John - Try infert[,toolong] = sapply(infert[,toolong],cut2,g=10,levels.mean=TRUE) - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Processing large datasets

2011-05-25 Thread Steve Lianoglou
Hi, On Wed, May 25, 2011 at 11:00 AM, Mike Marchywka marchy...@hotmail.com wrote: [snip] If your datasets are *really* huge, check out some packages listed under the Large memory and out-of-memory data section of the HighPerformanceComputing task view at CRAN:

Re: [R] Adjusted Rate Ratios in R

2011-05-25 Thread Walmes Zeviani
Matthew, You can change the matrix (restriction) involved. Start from help(contr.sum) to know how specify this. Walmes. == Walmes Marques Zeviani LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)

Re: [R] stepwise selection cox model

2011-05-25 Thread David Winsemius
On May 25, 2011, at 12:11 PM, linda Porz wrote: Many thanks for your reply. I have run a stepwise selection in Stata and R using the function fastbw (rule=p) from Design package. Both functions give the same results. Is this because both functions do the same job or can it be that for

Re: [R] How do I assign boolean (o,1) values to a column?

2011-05-25 Thread Xenimes
Thankyou very much, I managed to count he numbr of Markers 2 linked to Markers 3. And Markers 1 to Markers 3 with the aggregate function: with(data,aggregate(Marker1,list(Marker2=Marker2),length)) data2-with(data,aggregate(Marker1,list(Marker2=Marker2,Marker3=Merker3),length)) So, now is easy I

Re: [R] How to intantiate a list of data.frames?

2011-05-25 Thread Rui Maximo
Hi Josh, You are definitely right. And were all time. Yes, the problem was always with the write.csv(). I though it was with the ds. Thank you very much. Cheers, Rui Date: Tue, 24 May 2011 14:30:56 -0700 Subject: Re: [R] How to intantiate a list of data.frames? From: jwiley.ps...@gmail.com

Re: [R] stepwise selection cox model

2011-05-25 Thread linda Porz
Many thanks for your reply. I have run a stepwise selection in Stata and R using the function fastbw (rule=p) from Design package. Both functions give the same results. Is this because both functions do the same job or can it be that for different data one will have different results? Many

[R] Subtracting rows by id

2011-05-25 Thread Sara Maxwell
Dear R users, I have two datasets: id1 - c(rep(1,10), rep(2,10), rep(3,10)) value1 - sample(1:100, 30, replace=TRUE) dataset1 - cbind(id1,value1) id2 - c(1,2,3) subtract.value - c(1,3,5) dataset2 - cbind(id2, subtract.value) I want to subtract the number of rows in the subtract.value that

Re: [R] barplot groups of different size i.e. height is NOT a matrix

2011-05-25 Thread Walmes Zeviani
You can produce a graph similar to the ggplot with lattice::barchart, require(lattice) dataset - data.frame(Main=c(A,A,A,B,B), Detail=c(a,b,c,1,2), value=runif(5, min= 0.5, max=1)) barchart(value~Detail|Main, data=dataset,

Re: [R] Data Frame housekeeping

2011-05-25 Thread David Winsemius
On May 25, 2011, at 1:16 PM, Scott Hatcher wrote: Hello Dr. Winsemius, First of all, thank you for your prompt and helpful reply. Also, for providing something I hoped would be produced from joining this mailing list: a means of discovering incredibly useful packages such as the

Re: [R] Fwd: transpose ?

2011-05-25 Thread Dennis Murphy
Hi: Does this work? dd - read.table(textConnection( C C C C T T G G A A C C G G C C G G T T A A A A T A T T C C G G C C C C T T G G A A C C G G C C ), stringsAsFactors = FALSE) # Convert the data frame to a

Re: [R] What does smaller than comparison do on strings?

2011-05-25 Thread Dennis Murphy
Hi: Here are two alternatives that do work as you expect; sprintf() is your friend: sprintf(%2d, 1:12) [1] 1 2 3 4 5 6 7 8 9 10 11 12 sprintf(%02d, 1:12) [1] 01 02 03 04 05 06 07 08 09 10 11 12 sprintf(%2d, 1:12) 10 [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE FALSE

Re: [R] grep pattern

2011-05-25 Thread jim holtman
try this using strsplit: x - round(runif(10)*10, digits=0) y - as.Date(x, origin=1970-01-01) str(y) Class 'Date' num [1:10] 26551 37212 57285 90821 20168 ... y1 - as.character(y) str(y1) chr [1:10] 2042-09-11 2071-11-19 2126-11-04 2218-08-30 2025-03-21 2215-12-22 ... x - strsplit(y1,

Re: [R] matrix Manipulation...

2011-05-25 Thread Jim Silverton
Hello everyone, I have a 2 x 5 matrix: say 0.2 0.3 1 -1 3 0.2. 0.4 5 0.5 -1 I want to replace all the values greater than or equal to 1 with 1 and those less than or equal to 0 with 0. So I should end up with a mtrix looking like: 0.2 0.3 1 0 1 0.2. 0.4 1 0.5 0

Re: [R] matrix Manipulation...

2011-05-25 Thread Sarah Goslee
It's very easy to do in two steps: testmat - matrix(c(.2, .3, 1, -1, 3, .2, .4, 5, .5, -1), byrow=TRUE, nrow=2) testmat [,1] [,2] [,3] [,4] [,5] [1,] 0.2 0.31 -1.03 [2,] 0.2 0.45 0.5 -1 testmat[testmat = 1] - 1 testmat[testmat 0] - 0 testmat [,1] [,2] [,3] [,4]

Re: [R] Importing fixed-width data

2011-05-25 Thread Dennis Murphy
I get a data frame on my end: lines - 2011-05-13 00:00:00 EONAAL330 dfa13002516PSCNONA 2011-05-13 00:00:01 EONAAL223 laa13044510AS.NONM 2011-05-13 00:00:05 EONBHS229 mia13001621NON df = read.fwf(textConnection(lines), widths=c(19,-4,7,3,8,2,1,3,1),

[R] Job opening at Harvard Business School

2011-05-25 Thread Ao, Xiang
Dear Colleagues, I'd like to draw your attention to the following job available at the Harvard Business School. We are looking for a candidate with strong statistical/econometrical background, with strong programming skills in R or Stata. Please apply through the following link. If you know

Re: [R] What are the common Standard Statistical methods used for the analysis of a dataset

2011-05-25 Thread Michael Dewey
At 00:41 25/05/2011, Greg Snow wrote: The only statistical method that I know of that can be applied to any dataset without further definition of the nature of the data or the question being asked is SnowsCorrectlySizedButOtherwiseUselessTestOfAnything which is found in the TeachingDemos

[R] Accessing elements of a list

2011-05-25 Thread Seth W Bigelow
I have a list that is made of lists of varying length. I wish to create a new vector that contains the last element of each list. So far I have used sapply to determine the length of each list, but I'm stymied at the part where I index the list to make a new vector containing only the last item

Re: [R] Accessing elements of a list

2011-05-25 Thread David Winsemius
On May 25, 2011, at 3:25 PM, Seth W Bigelow wrote: I have a list that is made of lists of varying length. I wish to create a new vector that contains the last element of each list. So far I have used sapply to determine the length of each list, but I'm stymied at the part where I index

Re: [R] Accessing elements of a list

2011-05-25 Thread Marc Schwartz
On May 25, 2011, at 2:25 PM, Seth W Bigelow wrote: I have a list that is made of lists of varying length. I wish to create a new vector that contains the last element of each list. So far I have used sapply to determine the length of each list, but I'm stymied at the part where I index the

Re: [R] Accessing elements of a list

2011-05-25 Thread David Winsemius
On May 25, 2011, at 3:25 PM, Seth W Bigelow wrote: I have a list that is made of lists of varying length. I wish to create a new vector that contains the last element of each list. So far I have used sapply to determine the length of each list, but I'm stymied at the part where I index

Re: [R] Subtracting rows by id

2011-05-25 Thread Dennis Murphy
Hi: Interesting problem. Here's one approach: library(plyr) # Read in your datasets as data frames rather than matrices dataset1 - data.frame(id1 = rep(1:3, each = 10), value1 = sample(seq_len(100), 30, replace = TRUE)) dataset2 - data.frame(id2 = 1:3, subtract.value =

Re: [R] What are the common Standard Statistical methods used fo

2011-05-25 Thread Ted Harding
[See in-line below] On 25-May-11 19:14:11, Michael Dewey wrote: At 00:41 25/05/2011, Greg Snow wrote: The only statistical method that I know of that can be applied to any dataset without further definition of the nature of the data or the question being asked is

Re: [R] Processing large datasets

2011-05-25 Thread Mike Marchywka
Date: Wed, 25 May 2011 12:32:37 -0400 Subject: Re: [R] Processing large datasets From: mailinglist.honey...@gmail.com To: marchy...@hotmail.com CC: ro...@bestroman.com; r-help@r-project.org Hi, On Wed, May 25, 2011 at 11:00 AM, Mike

Re: [R] Data Frame housekeeping

2011-05-25 Thread Scott Hatcher
Hello Dr. Winsemius, First of all, thank you for your prompt and helpful reply. Also, for providing something I hoped would be produced from joining this mailing list: a means of discovering incredibly useful packages such as the reshape2 one you have introduced me too. I have a follow up

[R] how to compute the inverse percentile of a given observation w.r.t. a reference distribution

2011-05-25 Thread rudi
Hi, can anyone help me to figure out how to compute the percentile of an individual observation with respect to a reference distribution. What I mean is. Let's assume I have a vector consisting of 10 numbers {3,5,8,1,9,5,4,3,5.5,7} and I want figure out what percentile the number 4.9 corresponds

Re: [R] how to compute the inverse percentile of a given observation w.r.t. a reference distribution

2011-05-25 Thread David Winsemius
On May 25, 2011, at 3:42 PM, rudi wrote: Hi, can anyone help me to figure out how to compute the percentile of an individual observation with respect to a reference distribution. What I mean is. Let's assume I have a vector consisting of 10 numbers {3,5,8,1,9,5,4,3,5.5,7} and I want figure

Re: [R] how to compute the inverse percentile of a given observation w.r.t. a reference distribution

2011-05-25 Thread Jorge Ivan Velez
Hi Rudi, Take a look at ?ecdf HTH, Jorge On Wed, May 25, 2011 at 3:42 PM, rudi wrote: Hi, can anyone help me to figure out how to compute the percentile of an individual observation with respect to a reference distribution. What I mean is. Let's assume I have a vector consisting of 10

Re: [R] What are the common Standard Statistical methods used for the analysis of a dataset

2011-05-25 Thread Greg Snow
How can anyone overlook the intra-ocular trauma test (or sometimes called the inter-ocular concussion test). But the i-o trauma test needs either a small data set or an appropriate graph of the data (or can you look at a dataset of a hundred columns and a million rows and do an intra-ocular

Re: [R] Fwd: Opening R in 64-bit version by default

2011-05-25 Thread John C Frain
I have no problems configuring .r files to start in Emacs or RStudio and then use Emacs or RStudio to call the required version of R. You might check when you open with other from Windows Explorer that the check box Always open with this program is ticked. If you are using Windows 7 you can set

Re: [R] What are the common Standard Statistical methods used for the analysis of a dataset

2011-05-25 Thread Stephan Kolassa
Dear all, may I suggest the acronym IOTT for the inter-ocular trauma test? Now we just need someone to implement iot.test(). I assume it will appear on CRAN within the next 24 hours. Looking forward to yet another base package, Stephan Am 25.05.2011 23:36, schrieb Greg Snow: How can

Re: [R] how to compute the inverse percentile of a given observation w.r.t. a reference distribution

2011-05-25 Thread Dennis Murphy
Hi: On Wed, May 25, 2011 at 12:42 PM, rudi rudi.stras...@gmail.com wrote: Hi, can anyone help me to figure out how to compute the percentile of an individual observation with respect to a reference distribution. What I mean is. Let's assume I have a vector consisting of 10 numbers

Re: [R] Fwd: Opening R in 64-bit version by default

2011-05-25 Thread Duncan Murdoch
On 25/05/2011 5:43 PM, John C Frain wrote: I have no problems configuring .r files to start in Emacs or RStudio and then use Emacs or RStudio to call the required version of R. You might check when you open with other from Windows Explorer that the check box Always open with this program is

Re: [R] how to compute the inverse percentile of a given observation w.r.t. a reference distribution

2011-05-25 Thread David Winsemius
On May 25, 2011, at 5:50 PM, Dennis Murphy wrote: Hi: On Wed, May 25, 2011 at 12:42 PM, rudi rudi.stras...@gmail.com wrote: Hi, can anyone help me to figure out how to compute the percentile of an individual observation with respect to a reference distribution. What I mean is. Let's

Re: [R] Subtracting rows by id

2011-05-25 Thread Sara Maxwell
That worked perfectly. Thank you Dennis - I very much appreciate the help! Sara Maxwell, PhD, Postdoctoral Fellow Marine Conservation Institute University of California Santa Cruz Long Marine Laboratory 100 Shaffer Road Santa Cruz CA 95060 USA +1 206 355 3249

Re: [R] panel.first problem when plotting with formula

2011-05-25 Thread David Winsemius
On May 25, 2011, at 5:56 PM, Gene Leynes wrote: David, Peter (and others), If you're interested, I submitted this as a bug, and was informed of the error of my ways by Professor Ripley * His informative reply is copied below. * The short answer is that panel.first is not a documented

  1   2   >