Re: [R] adding the mean and standard deviation to boxplots

2008-07-23 Thread Fernando Marmolejo-Ramos
Dear users This is a message I was directing to Harold Baize but because I pressed the wrong button the message got lost g!!! So I’m doing it all over again: Lets suppose I have three batches of data: a - rnorm(50,2500,300) b - rnorm(50,3500,250) c - rnorm(50,4000,200) # Now I want to

Re: [R] Accessing individual variables from summary of lm

2008-07-23 Thread Mark Difford
Hi Ben, Sorry (still a little out-of-tune), perhaps what you really need to know about is ?[ HTH, Mark. Mark Difford wrote: Hi Ben, If you wouldn't mind, how do I access the individual components inside coefficients matrix? What you want to know about is ?attributes ##

Re: [R] Accessing individual variables from summary of lm

2008-07-23 Thread Mark Difford
Hi Ben, If you wouldn't mind, how do I access the individual components inside coefficients matrix? What you want to know about is ?attributes ## attributes(model) model$coefficients model$coefficients[1] model$coefficients[2:4] model$coefficients[c(1,5)] HTH, Mark. ascentnet wrote:

[R] mle2(): logarithm of negative pdfs

2008-07-23 Thread Zornitsa Luleva
Hi, In order to use the mle2-function, one has to define the likelihood function itself. As we know, the likelihood function is a sum of the logarithm of probability density functions (pdf). I have implemented myself the pdfs that I am using. My problem is, that the pdfs values are negative and

Re: [R] Editor for Mac

2008-07-23 Thread Hans-Peter Suter
Thanks for the answers, but I'm looking for an editor like Tinn-R. What about VM Fusion and continue to use Tinn-R then? -- Regards, Hans-Peter PS: I use TextMate (and like it) __ R-help@r-project.org mailing list

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Mark Difford
Hi All, It really comes down to a question of attitude: you either want to learn something fundamental or core and so bootstrap yourself to a better place (at least away from where you are), or you don't. As Marc said, Michal seems to have erected a wall around his thinking. I don't think it's

Re: [R] mle2(): logarithm of negative pdfs

2008-07-23 Thread Patrizio Frederic
this is an off-topic, of course! by definition, pdf MUST BE POSITIVE and log function is defined ONLY for positive values. check your pdf code and find out the errors. regards Patrizio Frederic +- | Patrizio Frederic | Research associate in

Re: [R] S4 : setGeneric for classical methods

2008-07-23 Thread Martin Maechler
CG == Christophe Genolini [EMAIL PROTECTED] on Tue, 22 Jul 2008 19:04:37 +0200 writes: CG Prof Brian Ripley [EMAIL PROTECTED] a écrit : On Tue, 22 Jul 2008, [EMAIL PROTECTED] wrote: Hi the list (well, half of the list, only the one who are not on holidays...)

Re: [R] experimental semivariogram

2008-07-23 Thread ONKELINX, Thierry
Alessandro, Have a look at the gstat package. library(gstat) demo(examples) demo(krige) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel

Re: [R] Indicator Kriging?

2008-07-23 Thread ONKELINX, Thierry
Sascha, Have a look at ?krige in the gstat package. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg

[R] maximum likelihood method to fit a model

2008-07-23 Thread silvia narduzzi
Dear R users, I use the glm() function to fit a generalized linear model with gamma distribution function and log link. I have read in the help page that the default method used by R is glm.fit (iteratively reweighted least squares, IWLS). Is it possible to use maximum likelihood method?

Re: [R] rpart confidence intervals?

2008-07-23 Thread Richard Pearson
Hi RichardP I guess you'll increase your chances of a response if you include some affiliation info. This could also avoid getting you confused with other people - I thought for a minute I'd been sleep-emailing :-) Cheers A N Other RichardP RichardP wrote: hi, I am using rpart with a

Re: [R] How to simulate heteroscedasticity (correlation)

2008-07-23 Thread Patrizio Frederic
Now I also want to generate two correlated variables where the error variance vary over the variable-correlation. And I want to plot this for showing heteroscedasticity. Like shown here: http://upload.wikimedia.org/wikipedia/de/1/1b/Heteroske2.png Is that possible with R? of course it

[R] par() function does not work

2008-07-23 Thread Fabio Sanchez
Dear R-nautes, I installed the 2.7.1 version of R and found it is not possible to modify graphical parameters with par(). for example; par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) par$mfrow NULL Does any one know what is the cause of this problem? Regards, Fabio -- Fabio

Re: [R] par() function does not work

2008-07-23 Thread john seers (IFR)
Hi Fabio Works OK for me. par(mfrow=c(2,2)) par(mfrow) [1] 2 2 But then I am using Windows ... sessionInfo() R version 2.7.1 (2008-06-23) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United

Re: [R] maximum likelihood method to fit a model

2008-07-23 Thread Prof Brian Ripley
On Wed, 23 Jul 2008, silvia narduzzi wrote: Dear R users, I use the glm() function to fit a generalized linear model with gamma distribution function and log link. I have read in the help page that the default method used by R is glm.fit (iteratively reweighted least squares, IWLS). Is it

Re: [R] par() function does not work

2008-07-23 Thread john seers (IFR)
Hi Fabio Have you used the name c for something else? Try typing in c at the command line, you should see something like: c function (..., recursive = FALSE) .Primitive(c) Regards John --- for example; par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) par$mfrow NULL

Re: [R] maximum likelihood method to fit a model

2008-07-23 Thread Patrizio Frederic
dear Silvia, quoting Venables WN and Ripley DB (1994) Modern Applied Statistics with S-plus, sringer, pag 185: Since explicit expressions for the maximum likelihood estimators are not usually available estimates MUST be calculate iteratively means that glm.fit performs MLE indirectly and

Re: [R] par() function does not work

2008-07-23 Thread Henrique Dallazuanna
Perhaps you have a function called 'par' in your workspace. On Wed, Jul 23, 2008 at 6:56 AM, Fabio Sanchez [EMAIL PROTECTED] wrote: Dear R-nautes, I installed the 2.7.1 version of R and found it is not possible to modify graphical parameters with par(). for example; par(mfrow=c(2,2))

Re: [R] Calculating Betweenness - Efficiency problem

2008-07-23 Thread Gabor Csardi
Senthil, sending a 12Mb file to the list is not a good idea. I've run the code in my previous email without any problem, so you need to be a bit more specific about what went wrong for you. This is what I get: library(igraph) tab - read.csv(/tmp/Test.csv) dim(tab) [1] 304711 2

Re: [R] adding the mean and standard deviation to boxplots

2008-07-23 Thread jim holtman
?bxp This is the underlying routine called by boxplot and you can supply your own values to the 5 that define a boxplot. On Wed, Jul 23, 2008 at 2:24 AM, Fernando Marmolejo-Ramos [EMAIL PROTECTED] wrote: Dear users This is a message I was directing to Harold Baize but because I pressed the

Re: [R] Combining 4th column from 30 files

2008-07-23 Thread Henrique Dallazuanna
Maybe: sapply(lapply(dir(pattern=data), read.table), '[[', 4) On Wed, Jul 23, 2008 at 5:21 AM, Daren Tan [EMAIL PROTECTED] wrote: Better approach than this brute force ? mm - NULL for (i in dir(pattern=data)) { m - readTable(i); mm - cbind(mm, m[,4]) }

Re: [R] par() function does not work

2008-07-23 Thread Duncan Murdoch
Fabio Sanchez wrote: Dear R-nautes, I installed the 2.7.1 version of R and found it is not possible to modify graphical parameters with par(). for example; par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) That's not an error from par(), it's an error from c(). I

Re: [R] How to....

2008-07-23 Thread Jim Lemon
On Tue, 2008-07-22 at 16:31 -0400, Jia Ying Mei wrote: Hi everyone, I am not new to R, but its been over a year since I've used it, so I don't remember how to do some things. I have a data set (in excel currently, but will be converted to text), that has date, country and price, with a

Re: [R] R package

2008-07-23 Thread Prof Brian Ripley
On Tue, 8 Jul 2008, Duncan Murdoch wrote: On 7/8/2008 10:53 AM, Sergi M.Garrido wrote: Hello, I have tried to create a package, and I have got it. I checked the files and I built the package. Nevertheless, I want a .pdf file with the package's documentation. Anyone know what I have to

Re: [R] Editor for Mac

2008-07-23 Thread stephen sefick
simultron On Wed, Jul 23, 2008 at 4:04 AM, Hans-Peter Suter [EMAIL PROTECTED] wrote: Thanks for the answers, but I'm looking for an editor like Tinn-R. What about VM Fusion and continue to use Tinn-R then? -- Regards, Hans-Peter PS: I use TextMate (and like it)

Re: [R] par() function does not work

2008-07-23 Thread Fabio Sanchez
Thank you all, I accidentally loaded a variable named c. All the best, Fabio On Wed, Jul 23, 2008 at 1:08 PM, Prof Brian Ripley [EMAIL PROTECTED] wrote: Did you start R with --vanilla to check that this is not something you have done? It is good practice, and I suspect will show you that

Re: [R] par() function does not work

2008-07-23 Thread Peter Dalgaard
Fabio Sanchez wrote: Dear R-nautes, I installed the 2.7.1 version of R and found it is not possible to modify graphical parameters with par(). for example; par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) par$mfrow NULL Does any one know what is the cause of

Re: [R] average replicate probe values

2008-07-23 Thread jim holtman
It would be helpful if you included a sample of the data so that we could understand what you would like to do with it (before/after pictures). ?aggregate On Tue, Jul 22, 2008 at 9:57 PM, Kaposi-Novak, Pal [EMAIL PROTECTED] wrote: Hi, Could somebody tell me how I can average expression values

Re: [R] Decoding subscripts/superscripts from CSVs

2008-07-23 Thread Jim Lemon
On Tue, 2008-07-22 at 16:18 -0400, [EMAIL PROTECTED] wrote: Hi, I have a CSV file with various biological reactions. Subscripts, superscripts, and italics are encoded in carats, and I was wondering if R can actually recognize those and print actual superscripts, etc. Here's an example:

[R] Using RODBC to use SQL queries

2008-07-23 Thread Megan J Bellamy
Hello, I am new to the RODBC package, but I have looked over the PDF as well as a few websites that go over the SQL language. I can connect to my database fine using channel-odbcConnect(Oracle ODBC) # then am prompted to enter my user id and password After that I'd like to use the odbcQuery

[R] Simple... but...

2008-07-23 Thread Shubha Vishwanath Karanth
Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __

[R] [Fwd: Re: Coefficients of Logistic Regression from bootstrap - how to get them?]

2008-07-23 Thread Michal Figurski
I think the argument supporting the use of bootstrap to determine coefficients, as opposed to just running linear regression on the whole dataset, is the comparison of Rsq and prediction errors between these two approaches - page 1502. There's a substantial difference in favor of the bootstrap

Re: [R] Simple... but...

2008-07-23 Thread Henrique Dallazuanna
If I understand: sort(c(x,y)) or if you want combine the elements: as.vector(mapply(c, x, y)) On Wed, Jul 23, 2008 at 9:54 AM, Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote: Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do

Re: [R] Simple... but...

2008-07-23 Thread Doran, Harold
Shubba I'm confused. Your first post said the result should be c(1,2,3,4,5,6) when x and y are combined. The code I sent does that. But here you say your result should be c(4,1,2,5,2,3). What do you want your result to actually be? -Original Message- From: Shubha Vishwanath Karanth

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Michal Figurski
Thank you Gustaf, I apologize for not including an example data in my first email. Nevertheless, your code worked for me excellently - I only added 55 as the size of sample. I must admit this code looks so much simpler, compared to SAS. I am beginning to love R, despite some disrespectful

Re: [R] Simple... but...

2008-07-23 Thread Shubha Vishwanath Karanth
Guess this should be fine c(rbind(x,y)) Please let me know if there are some better ways... Thanks, Shubha -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, July 23, 2008 6:25 PM To: [EMAIL PROTECTED]

Re: [R] Simple... but...

2008-07-23 Thread Doran, Harold
x - c(1,3,5) y - c(2,4,6) sort(c(x,y)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, July 23, 2008 8:55 AM To: [EMAIL PROTECTED] Subject: [R] Simple... but... Hi R, If x=c(1,3,5)

Re: [R] Simple... but...

2008-07-23 Thread Wacek Kusnierczyk
Shubha Vishwanath Karanth wrote: Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way the absolutely best way is: ?c vQ __ R-help@r-project.org

Re: [R] adding the mean and standard deviation to boxplots

2008-07-23 Thread John Kane
This thread may help http://www.nabble.com/adding-the-mean-and-standard-deviation-to-boxplots-td15271398.html --- On Wed, 7/23/08, Fernando Marmolejo-Ramos [EMAIL PROTECTED] wrote: From: Fernando Marmolejo-Ramos [EMAIL PROTECTED] Subject: Re: [R] adding the mean and standard deviation to

Re: [R] Simple... but...

2008-07-23 Thread Mitchell Maltenfort
Z=NULL;for (i in 1:3) Z=c(Z,c(x[i],y[i])) On Wed, Jul 23, 2008 at 8:54 AM, Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote: Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way Thanks, Shubha This

Re: [R] Simple... but...

2008-07-23 Thread Shubha Vishwanath Karanth
OK, Let x=c(4,2,2) y=c(1,5,3) My result should be c(4,1,2,5,2,3) Thanks, Shubha -Original Message- From: Doran, Harold [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2008 6:47 PM To: Shubha Vishwanath Karanth; [EMAIL PROTECTED] Subject: RE: [R] Simple... but... x -

Re: [R] Simple... but...

2008-07-23 Thread john seers (IFR)
This is definitely the best way: c(lapply(1:length(x), function(i, x, y) c(x[i], y[i]), x, y), recursive=TRUE) JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: 23 July 2008 13:55 To: [EMAIL PROTECTED]

[R] Convert list of lists -- data frame

2008-07-23 Thread Michael Friendly
For a function that takes an argument as a list of lists of parameters, I'd like to be able to convert that to a data.frame and vice versa, but can't quite figure out how. pats - list(structure(list(shape = 0, shape.col = black, shape.lty = 1, cell.fill = white, back.fill = white, label = 1,

Re: [R] Simple... but...

2008-07-23 Thread Doran, Harold
How about this as.vector(t(cbind(x,y))) -Original Message- From: Shubha Vishwanath Karanth [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2008 9:17 AM To: Doran, Harold; [EMAIL PROTECTED] Subject: RE: [R] Simple... but... OK, Let x=c(4,2,2) y=c(1,5,3) My

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Johannes Huesing
It seems you have accidentally hit a surgeons' mailing list where all you wanted was some advice how to use this scalpel on your body. Sorry if we can't be of any help without intimidating you with unrelated and pompous terms -- like coagulation. Michal J. Figurski [EMAIL PROTECTED] [Wed, Jul 23,

Re: [R] Simple... but...

2008-07-23 Thread Dimitris Rizopoulos
check the following: x - c(1,3,5) y - c(2,4,6) c(t(cbind(x, y))) c(matrix(c(x, y), 2, by = TRUE)) I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel:

Re: [R] Using RODBC to use SQL queries

2008-07-23 Thread Prof Brian Ripley
You should at least start with higher-level functions like sqlFetch(). Oh, and reading the posting guide (you show us no examples let alone error message) and the tests.R examples file which comes with RODBC. SQL syntax is DBMS-specific, so we can't comment on abstract examples (and it is a

Re: [R] Simple... but...

2008-07-23 Thread Jim Porzak
Hi Shubha, Assuming you are after ordering by position in x and y (and not values), how about as.vector(t(cbind(x, y))) HTH, Jim Porzak Responsys, Inc. San Francisco, CA http://www.linkedin.com/in/jimporzak On Wed, Jul 23, 2008 at 5:54 AM, Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote:

Re: [R] Simple... but...

2008-07-23 Thread Nutter, Benjamin
x - c(1,3,5) y - c(2,4,6) xy - sort(c(x,y)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: Wednesday, July 23, 2008 8:55 AM To: [EMAIL PROTECTED] Subject: [R] Simple... but... Hi R, If x=c(1,3,5) y=c(2,4,6)

Re: [R] Simple... but...

2008-07-23 Thread Ted Harding
On 23-Jul-08 12:54:49, Shubha Vishwanath Karanth wrote: Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way Thanks, Shubha Your query is ambiguous, in that it is not clear whether you want a) The elements of the

Re: [R] Simple... but...

2008-07-23 Thread Gabor Grothendieck
Try c(rbind(x, y)) On Wed, Jul 23, 2008 at 8:54 AM, Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote: Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way Thanks, Shubha This e-mail may contain

Re: [R] Simple... but...

2008-07-23 Thread Gustaf Rydevik
On Wed, Jul 23, 2008 at 3:23 PM, Doran, Harold [EMAIL PROTECTED] wrote: Shubba I'm confused. Your first post said the result should be c(1,2,3,4,5,6) when x and y are combined. The code I sent does that. But here you say your result should be c(4,1,2,5,2,3). What do you want your result to

Re: [R] Simple... but...

2008-07-23 Thread Wacek Kusnierczyk
Shubha Vishwanath Karanth wrote: Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way ... but seriously, rbind(x,y)[1:6] is one concise way to do it (x and y are bound into rows in a matrix which

Re: [R] Using RODBC to use SQL queries

2008-07-23 Thread Albin Blaschka
Megan J Bellamy schrieb: After that I'd like to use the odbcQuery function and the SQL statement: SELECT * FROM table_name WHERE SAMPLE_YEA LIKE 1965% According to the RODBC PDF, the odbcQuery command should accept any valid SQL statement. Is there something wrong with my syntax? I have

Re: [R] Quantitative analysis of non-standard scatter plots.

2008-07-23 Thread Ben Bolker
Firas Swidan frsswdn at gmail.com writes: Hi, I am having difficulties in finding ways to analyse scatter plots and quantitatively differentiate between them. Try quantile regression, implemented in Roger Koenker's quantreg package. There's a very thorough vignette

Re: [R] [Fwd: Re: Coefficients of Logistic Regression from bootstrap - how to get them?]

2008-07-23 Thread Gustaf Rydevik
On Wed, Jul 23, 2008 at 3:14 PM, Michal Figurski [EMAIL PROTECTED] wrote: I think the argument supporting the use of bootstrap to determine coefficients, as opposed to just running linear regression on the whole dataset, is the comparison of Rsq and prediction errors between these two

Re: [R] Simple... but...

2008-07-23 Thread Prof Brian Ripley
On Wed, 23 Jul 2008, Shubha Vishwanath Karanth wrote: If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. I am assuming that you want to interleave the vectors, but that is not the only algorithm giving that result. How do I do it? I mean the best way

Re: [R] How to....

2008-07-23 Thread Jia Ying Mei
Thank you very much. As for the second part, for every price change, the percentage of every price change can be calculated (i.e. amount of change divided by previous price). I was looking for a way to merely find the mean and median of all price change percentages for each country. I don't

Re: [R] Simple... but...

2008-07-23 Thread Wacek Kusnierczyk
it's clear, he wants to combine x and y s that the result is (x[1], y[1], x[2], y[2], ...), unless i am confused as well ;) now, both rbind(x,y)[1:length(x)] and as.vector(mapply(c,x,y)) do the job, but the former is *much* faster: t1 = function(n) as.vector(mapply(c, 1:n, 1:n)) t2 = function(n)

[R] RES: Simple... but...

2008-07-23 Thread Leandro Marino
I thinks this is the solution that you want! as.vector(matrix(c(x,y),byrow=T,ncol=3)) -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Wacek Kusnierczyk Enviada em: quarta-feira, 23 de julho de 2008 10:25 Para: R help Assunto: Re: [R] Simple... but... Shubha

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Gustaf Rydevik
On Wed, Jul 23, 2008 at 4:08 PM, Michal Figurski [EMAIL PROTECTED] wrote: Gustaf, I am sorry, but I don't get the point. Let's just focus on predictive performance from the cited passage, that is the number of values predicted within 15% of the original value. So, the predictive performance

Re: [R] Convert list of lists -- data frame

2008-07-23 Thread Henrique Dallazuanna
Try this: pats.df - do.call(rbind, pats) On Wed, Jul 23, 2008 at 10:23 AM, Michael Friendly [EMAIL PROTECTED] wrote: For a function that takes an argument as a list of lists of parameters, I'd like to be able to convert that to a data.frame and vice versa, but can't quite figure out how.

Re: [R] sequential sum of a vector...

2008-07-23 Thread Patrizio Frederic
try this colSums(matrix(x,8)) regards, PF +- | Patrizio Frederic | Research associate in Statistics, | Department of Economics, | University of Modena and Reggio Emilia, | Via Berengario 51, | 41100 Modena, Italy | | tel: +39 059 205 6727 |

Re: [R] Convert list of lists -- data frame

2008-07-23 Thread Patrizio Frederic
try ?unlist it may help regards +- | Patrizio Frederic | Research associate in Statistics, | Department of Economics, | University of Modena and Reggio Emilia, | Via Berengario 51, | 41100 Modena, Italy | | tel: +39 059 205 6727 | fax: +39 059

Re: [R] sequential sum of a vector...

2008-07-23 Thread Shubha Vishwanath Karanth
Many Thanks Jorge... That was one more way...Is it possible if I can do this without using rep(1:10,each=8) or the groupingbecause I feel the number 8 here is fixed... If there is some technique of tracking the position of first 8, then next 8... don't know whether I am clear in conveying...

Re: [R] sequential sum of a vector...

2008-07-23 Thread Marc Schwartz
on 07/23/2008 09:03 AM Shubha Vishwanath Karanth wrote: Hi R, Let, x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8 elements. So, my new vector should look like: c(36,100,164,228,292,356,420,484,548,612) I used:

Re: [R] sequential sum of a vector...

2008-07-23 Thread Richard . Cotton
x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8 elements. So, my new vector should look like: c(36,100,164,228,292,356,420,484,548,612) I used: aggregate(x,list(rep(1:10,each=8)),sum)[-1] or

Re: [R] sequential sum of a vector...

2008-07-23 Thread Jorge Ivan Velez
Dear Shubha, Try this: x=1:80 tapply(x,rep(1:10,each=8),sum) 1 2 3 4 5 6 7 8 9 10 36 100 164 228 292 356 420 484 548 612 HTH, Jorge On Wed, Jul 23, 2008 at 10:03 AM, Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote: Hi R, Let, x=1:80 I want to sum up first

[R] Using if, else statements

2008-07-23 Thread Robin Williams
Hi all, Again I have searched the net and so on, without finding an answer to this surely simple problem. A short bit of code would be appreciated. I have a object named `data' with the following column headings. Date, maxitemp, minitemp, admissions, d.o.w. Where d.o.w. is day of the week,

Re: [R] sequential sum of a vector...

2008-07-23 Thread William Revelle
At 7:33 PM +0530 7/23/08, Shubha Vishwanath Karanth wrote: Hi R, Let, x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8 elements. So, my new vector should look like: c(36,100,164,228,292,356,420,484,548,612) I used:

Re: [R] sequential sum of a vector...

2008-07-23 Thread Henrique Dallazuanna
Maybe: tapply(x, gl(10, 8), sum) or unlist(lapply(split(x, gl(10, 8)), sum)) On Wed, Jul 23, 2008 at 11:03 AM, Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote: Hi R, Let, x=1:80 I want to sum up first 8 elements of x, then again next 8 elements of x, then again another 8

Re: [R] Quantitative analysis of non-standard scatter plots.

2008-07-23 Thread Bogaso Cristofer
Have u checked skewness of data? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Firas Swidan Sent: 23 July 2008 18:38 To: r-help@r-project.org Subject: [R] Quantitative analysis of non-standard scatter plots. Hi, I am having difficulties in finding

Re: [R] Convert list of lists -- data frame

2008-07-23 Thread Jorge Ivan Velez
Dear Michael, Perhaps, data.frame(do.call(rbind,lapply(pats,function(x) t(as.matrix(x,ncol=10) HTH, Jorge On Wed, Jul 23, 2008 at 9:23 AM, Michael Friendly [EMAIL PROTECTED] wrote: For a function that takes an argument as a list of lists of parameters, I'd like to be able to convert

[R] How to control the memory?

2008-07-23 Thread rlearner309
Hi, I have a huge data set to deal with. Sometimes I got warning message about limitation of memory, sometimes R reads in the data but it is very slow. My question is, is there anything I can do to lift the memory limitation (I did memory.limit(4095), anything else I can do?). I know I can also

Re: [R] Convert list of lists -- data frame

2008-07-23 Thread Henrique Dallazuanna
Oh, you are rigth Marc, thanks. Another option is: pats.df - do.call(rbind.data.frame, pats) On Wed, Jul 23, 2008 at 1:10 PM, Marc Schwartz [EMAIL PROTECTED] wrote: on 07/23/2008 09:42 AM Henrique Dallazuanna wrote: Try this: pats.df - do.call(rbind, pats) Henrique, Take note of the

[R] Calling LISP programs in R

2008-07-23 Thread francogrex
I have written some programs in Common Lisp and I have been using SAS to pipe those programs to my lisp compiler in batch mode by using the %xlog and %xlst SAS commands. I wonder if there is in R a similar way to pipe commands to LISP so that all my work would be concentrated in R even when I

[R] shQuote and cat

2008-07-23 Thread Vadim Organovich
Dear R-users, It is my understanding that cat(shQuote(a.string)) should print the origintal a.string. Is this right? I am not sure cat() correctly prints strings which are generated by triple-shQuote(): shQuote(shQuote(a)) [1] a cat(shQuote(shQuote(shQuote(a))), '\n')

[R] Warning message in if else statement

2008-07-23 Thread Monica Pisica
Hi, I am using an if else statement inside a function …. If I use that function I have no problems …. If I use the function with the if else statement inside a second function I get the following waring: Warning message: In if (pval == 0) p_value - 2.2e-16 else p_value - pval : the

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Michal Figurski
Thank you all for your words of wisdom. I start getting into what you mean by bootstrap. Not surprisingly, it seems to be something else than I do. The bootstrap is a tool, and I would rather compare it to a hammer than to a gun. People say that hammer is for driving nails. This situation is

Re: [R] sequential sum of a vector...

2008-07-23 Thread denise xifaras
Dear Patrizio and all, Do you know a similar approach to this, so that *any* function is sequentially applied on a matrix? Particularly, instead of wanting to sum columns every 8 rows, how could we apply a linear regression to the columns of a matrix every 8 rows? ie, if we have a matrix say of

[R] Flip Matrix form file?

2008-07-23 Thread Chris82
Hello, I have a problem to flip a 200x200 matrix, which is imported by a .asc file. I want to flip the matrix like in a created example below: b - matrix(1:9,3,3,byrow=T) b [,1] [,2] [,3] [1,]123 [2,]456 [3,]789 b1 - apply(t(b),1,rev) b1 [,1]

Re: [R] Using if, else statements

2008-07-23 Thread jim holtman
You would have something that looks like this: if (data$d.o.w == Sat) data$admission - round(data$admission * 1.21) if (data$d.o.w == Sun) ... On Wed, Jul 23, 2008 at 11:44 AM, Robin Williams [EMAIL PROTECTED] wrote: Hi all, Again I have searched the net and so on, without finding an

Re: [R] Using if, else statements

2008-07-23 Thread jim holtman
My fingers slipped on the keyboard. Here what they intended to write. This sets up a list of the data and the matches on a subset for processing days - list(list(Sat, 1.21), list(Sun, 1.22), list(Mon, 0.91)) for (i in days){ .subset - data$d.o.w == i[[1]] # subset of data that matches

Re: [R] Using if, else statements

2008-07-23 Thread jim holtman
One more try and I quit: This is what happens if someone does not sent a sample of data you have to create things on the fly without testing. days - list(list(Sat, 1.21), list(Sun, 1.22), list(Mon, 0.91)) for (i in days){ .subset - data$d.o.w == i[[1]] # subset of data that matches

Re: [R] Using if, else statements

2008-07-23 Thread Patrick Burns
jjdow - sample(c('Sun', 'Mon', 'Tues'), 10, replace=TRUE) jjdata - data.frame(admission=1:10, d.o.w.=jjdow) # jjdata # admission d.o.w. #1 1 Tues #2 2 Tues #3 3 Tues #4 4Sun #5 5Mon #6 6Mon #7 7Sun #8

Re: [R] Warning message in if else statement

2008-07-23 Thread Erik Iverson
Monica - Monica Pisica wrote: Hi, I am using an if else statement inside a function …. If I use that function I have no problems …. If I use the function with the if else statement inside a second function I get the following waring: Warning message: In if (pval == 0) p_value - 2.2e-16 else

Re: [R] Using if, else statements

2008-07-23 Thread milton ruser
Just to clarify, if you have two data.frame, one with your data, other with data-admissions, just use data.merge-merge(my.df, data.weigth, by.x=data, by.y=data, all=T) miltinho On 7/23/08, milton ruser [EMAIL PROTECTED] wrote: Hi Rob Williams I think it is one way of you do the job.

Re: [R] Quantitative analysis of non-standard scatter plots.

2008-07-23 Thread Firas Swidan, PhD
How do I check that, and what quantification does it provide? Thanks, Firas. On Wed, 2008-07-23 at 21:20 +0530, Bogaso Cristofer wrote: Have u checked skewness of data? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Firas Swidan Sent: 23 July 2008

Re: [R] shQuote and cat

2008-07-23 Thread Duncan Murdoch
On 7/23/2008 12:20 PM, Vadim Organovich wrote: Dear R-users, It is my understanding that cat(shQuote(a.string)) should print the origintal a.string. Is this right? No, cat(a.string) should print the original a.string. shQuote(a.string) adds quotes so that a.string can be used in the shell.

Re: [R] Warning message in if else statement

2008-07-23 Thread Monica Pisica
Hi Erik, Thanks for your answer. I did print the p-value just before the statement and it is only one value – or at least I see only one value ….. that is strange. I am doing a test and I want to see what is it's p-value ….for example my function myf is like that: myf - function(m, se,

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-23 Thread Greg Snow
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michal Figurski Sent: Wednesday, July 23, 2008 10:22 AM To: r-help@r-project.org Subject: Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them? Thank you all for your words of

Re: [R] Flip Matrix form file?

2008-07-23 Thread Henrik Bengtsson
Hi. On Wed, Jul 23, 2008 at 9:23 AM, Chris82 [EMAIL PROTECTED] wrote: Hello, I have a problem to flip a 200x200 matrix, which is imported by a .asc file. I want to flip the matrix like in a created example below: b - matrix(1:9,3,3,byrow=T) b [,1] [,2] [,3] [1,]123

Re: [R] Quantitative analysis of non-standard scatter plots.

2008-07-23 Thread Daniel Folkinshteyn
I second that - quantile regression seems to be what you want. on 07/23/2008 10:10 AM Ben Bolker said the following: Firas Swidan frsswdn at gmail.com writes: Hi, I am having difficulties in finding ways to analyse scatter plots and quantitatively differentiate between them. Try

Re: [R] Combining 4th column from 30 files

2008-07-23 Thread Henrik Bengtsson
A few things that will help you, if not now then in the future: 1) Preallocate the result object. This allow you to avoid using cbind()/rbind(), which constantly creates a new large copy in each iteration. That will eventually bite you if you have a lot of data. In your case you know the number

[R] Histogram

2008-07-23 Thread Angelo Scozzarella
Hi, how can I treat data organised in classes and frequencies? Ex. class frequency 20-23 9 23-25 7 26-28 5 29-31 5 32-34 3 Thanks Angelo Scozzarella

Re: [R] Warning message in if else statement

2008-07-23 Thread Monica Pisica
Hi again, It seems one line in my function came chopped for whatever reason so the if else statement below should be: if (pval==0) p_value - 2.2e-16 else p_value - pval Thanks, Monica Date: Wed, 23 Jul 2008 13:24:45 -0500 From: [EMAIL PROTECTED] Subject: Re: [R] Warning

Re: [R] Change font-face in title

2008-07-23 Thread Mike Prager
Ok, thanks! Gabor Grothendieck [EMAIL PROTECTED] wrote: See ?title where its mentioned that calls are ok and a formula is a call. Actually the first ~ is not needed since its already a formula. On Tue, Jul 22, 2008 at 1:12 PM, Mike Prager [EMAIL PROTECTED] wrote: Gabor Grothendieck

[R] sum each row and output results

2008-07-23 Thread Rheannon
Hello, I have the following data frame (DF): V5V5.1V5.2 V5.3 V5.4 V5.5 2 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 3 -5890.18905 -6019.84665 -6211.06545 -6198.9353 -6616.8677 -6498.7183 4 -5890.18905 -6019.84665

[R] Q re iterating a process and appending results to output file

2008-07-23 Thread Eric C Banfield
Greetings. This is very basic but we can't figure it out. The following simple code counts how many values land in the tail (below a quantile) of a standardized normal distribution of random numbers. First two commands are inputs: c -0.05 i -2500 Second two commands are formulas I want to

  1   2   >