[R] Reading Input file

2009-12-26 Thread Maithili Shiva
Dear R helpers   I have some files in my say 'WORK' directory and the file names are say rate1.csv, rate2.csv, rate3.csv, rate4.csv   Because of some other requirement, I need to run the following commands   n = 4    rates = NULL   for (i in 1:n) rates[i] = (paste(`rate', i, ‘.csv`,

Re: [R] Reading Input file

2009-12-26 Thread Johannes Signer
On Sat, Dec 26, 2009 at 10:21 AM, Maithili Shiva maithili_sh...@yahoo.comwrote: Dear R helpers I have some files in my say 'WORK' directory and the file names are say rate1.csv, rate2.csv, rate3.csv, rate4.csv Because of some other requirement, I need to run the following commands n = 4

Re: [R] String question

2009-12-26 Thread Peter Dalgaard
Knut Krueger wrote: Will this do? temp - paste(m, 1:3, sep=,collapse=,) Unfortunately not, because I explained the example not detailed enough. The string could have different Items, like November, December, Monday, Tuesday, Daylight and so on Therefore I must count the Items of the

[R] Is SEM package of R suitable for sem analysis

2009-12-26 Thread Reeyarn_李智洋_10928113
Dears, I'm a college student and In doing my statistics homework. I use R with SEM package as my tool for sem analysis, but my teacher told me AMOS is more suitable for such analysis. Could someone help tell me whether it is true that some commercial software is better accepted in academic

Re: [R] Help with SVM package Kernlab

2009-12-26 Thread Vishal Thapar
Hi All, Thank you for your replies so far. I was hoping I could get some more input from you on this issue. It seems to me that I have hit a dead end here and would really appreciate some feedback. I have followed all the suggestions you have mentioned but they still this is stuck. Earlier I

Re: [R] Reading Input file

2009-12-26 Thread Maithili Shiva
Dear R helpers / Johannes Sir,   Unfortunately it didn't work. I am getting following warning messages.   1: In neweate[i] = read.csv(rates[i]) :   number of items to replace is not a multiple of replacement length. 2:  similar message 3:  similar message 4: similar message   Let me be

Re: [R] Is SEM package of R suitable for sem analysis

2009-12-26 Thread Bruno Falissard
A few years ago it could have been true, but now the package has improved (especially with the bootstrap procedure). At the moment there is no argument to recommend AMOS. Of course, some software like Mplus are actually better, but very specialized (and rather expensive). This is only a personal

Re: [R] Reading Input file

2009-12-26 Thread John Kane
First of all there seems to be something wrong with your equation rate_name[i] = (paste(`rate', i, ‘.csv`, sep = ‘’)) Try this rate_name[i] - paste(rate,i,.csv, sep=) I am not --- On Sat, 12/26/09, Maithili Shiva maithili_sh...@yahoo.com wrote: From: Maithili Shiva maithili_sh...@yahoo.com

Re: [R] Help with SVM package Kernlab

2009-12-26 Thread David Winsemius
Perhaps my response is not showing up on the r-help list due to the large number of recipients generated by the reply-all option triggering some sort of spam filter. So I am trimming them. On Dec 26, 2009, at 3:53 AM, Vishal Thapar wrote: Hi All, Thank you for your replies so far. I was

Re: [R] Help with SVM package Kernlab

2009-12-26 Thread David Winsemius
On Dec 26, 2009, at 3:53 AM, Vishal Thapar wrote: Hi All, Thank you for your replies so far. I was hoping I could get some more input from you on this issue. It seems to me that I have hit a dead end here and would really appreciate some feedback. I have followed all the suggestions you

Re: [R] [ how can sample from f(x)~x^(a-1)

2009-12-26 Thread Michael Erickson
On Fri, Dec 25, 2009 at 8:07 AM, khaz...@ceremade.dauphine.fr wrote: Hello all how can sample from f(x)~x^(a-1)*ind(0,min(b,-log(u)) in R? where a and b is positive constand and 0u1 If the idea is that X is a random variable, then you need to decide what kind of random variable it is. For

[R] Fwd: Why do histogram bars vary their width?

2009-12-26 Thread James Rome
I did histogram(~(Arrival4) | as.factor(Hour), type=count, breaks=16,ylab=Arrival Count, xlab=Arrival Rate/4,main=Friday EWR A22R D22L Configiration, layout=c(6,4), par.strip.text=list(cex=0.7)) Why do I get plots with different bar widths? See http://dl.dropbox.com/u/537118/Friday.pdf.

Re: [R] Help with SVM package Kernlab

2009-12-26 Thread Vishal Thapar
Hi David, Thank you so much for the pointer. I get it now. I did try the str(testSeq_df) and since it gave me more than 2 factors for each column, I believed that it was fine. I get the point clearly now. Thanks again for all your help. I really appreciate it. Sincerely, vishal On Sat, Dec 26,

Re: [R] Reading Input file

2009-12-26 Thread jim holtman
Use newrate[[i]] - read.csv(rates[i]) better yet, use a list and lapply newrate - lapply(paste('rate', 1:4, '.csv', sep=''), read.csv) On Sat, Dec 26, 2009 at 8:09 AM, Maithili Shiva maithili_sh...@yahoo.comwrote: Dear R helpers / Johannes Sir, Unfortunately it didn't work. I am getting

Re: [R] Fwd: Why do histogram bars vary their width?

2009-12-26 Thread David Winsemius
On Dec 26, 2009, at 10:38 AM, James Rome wrote: I did histogram(~(Arrival4) | as.factor(Hour), type=count, breaks=16,ylab=Arrival Count, xlab=Arrival Rate/4,main=Friday EWR A22R D22L Configiration, layout=c(6,4), par.strip.text=list(cex=0.7)) Why do I get plots with different bar widths?

Re: [R] Is SEM package of R suitable for sem analysis

2009-12-26 Thread Joe King
I am going to take SEM this next quarter in my doctoral program. My suggestion is to use the program your professor suggests and try to re-create your models in R using the SEM package. We are not going to use AMOS though we use EQS, and another prof on campus who teaches it in a different

[R] if else does not return right value

2009-12-26 Thread Muhammad Rahiz
Hi all, I'm not getting the right results for values that are 99 using the if else function. The following illustrates the problem x - as.matrix(read.table(test.txt)) x V1 V2 V3 [1,] 47 1 43 [2,] 83 2 42 [3,] 1 3 41 [4,] 39 4 40 [5,] 23 5 39 [6,] 23 6 38 [7,] 39 7 37

Re: [R] Multiple CHOLMOD errors when attempting poisson glmm

2009-12-26 Thread Marielle Postava-Davig
Thank you so much for replying. The data set I used for this particular output has 600 entries. The original had 1657 lines so I've already reduced it considerably. Here is a copy of the entire output with lme4 package information: substrate=read.csv(file.choose(),header=T) attach(substrate)

[R] Question regarding if statement in while loop

2009-12-26 Thread Stephanie Coffey
Hi all, I'm running R version 2.9.2 on a PC. I'm having a problem with a loop, and have tried using an if statement within to fix it, but to no avail. Any advice would be appreciated. Here is my code: * eblest - function(i,dir, sterr, weight,

Re: [R] Why do histogram bars vary their width?

2009-12-26 Thread Ted Harding
On 26-Dec-09 15:33:45, James Rome wrote: histogram(~(Arrival4) | as.factor(Hour), type=count, breaks=16,ylab=Arrival Count, xlab=Arrival Rate/4,main=Friday EWR A22R D22L Configiration, layout=c(6,4), par.strip.text=list(cex=0.7)) Why do I get plots with different bar widths? See

Re: [R] Question regarding if statement in while loop

2009-12-26 Thread Stephan Kolassa
Hi Stephanie, it sounds like R's exception handling may help, something like this: foo - try(eblest(i, dir5, sterr5, weight5, aux5)) if ( class(foo) == try-error ) next Take a look at ?try. HTH, Stephan Stephanie Coffey schrieb: Hi all, I'm running R version 2.9.2 on a PC. I'm having a

Re: [R] if else does not return right value

2009-12-26 Thread David Winsemius
See below: On Dec 26, 2009, at 12:58 PM, Muhammad Rahiz wrote: Hi all, I'm not getting the right results for values that are 99 using the if else function. The following illustrates the problem x - as.matrix(read.table(test.txt)) x V1 V2 V3 [1,] 47 1 43 [2,] 83 2 42 [3,] 1 3

[R] How to manipulate tables

2009-12-26 Thread James Rome
I am sorry to be bothering the list so much. I made a table of counts of flight arrivals by hour: cnts=tapply(Arrival4,list(Hour),table). There are up to 15 arrivals in a bin. cnts $`0` 1 2 3 4 5 6 7 8 9 10 13 1 2 5 9 2 7 5 4 2 4 1 $`1` 1 2 3 4 3 2 2 1 $`2` 1 3 2 2 . .

Re: [R] if else does not return right value

2009-12-26 Thread Muhammad Rahiz
Thanks David and Patrick, I need to use two statements for the if condition specified. Since the first statement feeds into the second, the ifelse function may just work for the dataset. I'm not sure if there will be issues later but I've tested it and it works. x -

Re: [R] How to manipulate tables

2009-12-26 Thread David Winsemius
On Dec 26, 2009, at 2:02 PM, James Rome wrote: I am sorry to be bothering the list so much. I made a table of counts of flight arrivals by hour: No, you made a list of tables, which is different. cnts=tapply(Arrival4,list(Hour),table). There are up to 15 arrivals in a bin. Why not

Re: [R] [BioC] How to do RMA without summary to probeset level?

2009-12-26 Thread Peng Yu
I think that you misunderstood me. As far as I know, RMA does three things: background correction, quantile normalization, and summary from probes to probesets. I want the probe values after background correction and quantile normalization but before the summary. On Sat, Dec 26, 2009 at 12:07

Re: [R] How to manipulate tables

2009-12-26 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of James Rome Sent: Saturday, December 26, 2009 11:03 AM To: r-help@r-project.org Subject: [R] How to manipulate tables I am sorry to be bothering the list so much. I made a

[R] Is there a problem with lattice axes?

2009-12-26 Thread Ted Harding
After answering a previous post by James Rome: Re: [R] Why do histogram bars vary their width? I noticed that the lateral axis scales in the lattice histogram which I used for illustration are inconsistent with the frequencies. The example was: set.seed(54321) X -

[R] something similar to %include() in sas?

2009-12-26 Thread Wensui Liu
i am just wondering if there is an effective way to include other external codes into the program. thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] something similar to %include() in sas?

2009-12-26 Thread David Winsemius
On Dec 26, 2009, at 3:10 PM, Wensui Liu wrote: i am just wondering if there is an effective way to include other external codes into the program. ?source -- David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org

Re: [R] something similar to %include() in sas?

2009-12-26 Thread Jim Holtman
?source What is the problem you are trying to solve? Sent from my iPhone. On Dec 26, 2009, at 15:10, Wensui Liu liuwen...@gmail.com wrote: i am just wondering if there is an effective way to include other external codes into the program. thanks. [[alternative HTML version deleted]]

Re: [R] something similar to %include() in sas?

2009-12-26 Thread Gabor Grothendieck
source(abc.R) if you want to run the code in the abc.R file at that point. Or if you are looking for a macro facility see defmacro in gtools which is based on Thomas Lumley's R News 1/3 article where defmacro is presented. On Sat, Dec 26, 2009 at 3:10 PM, Wensui Liu liuwen...@gmail.com wrote: i

Re: [R] something similar to %include() in sas?

2009-12-26 Thread Wensui Liu
thanks, all, i think source() is the right one i am looking for. On Sat, Dec 26, 2009 at 3:13 PM, David Winsemius dwinsem...@comcast.netwrote: On Dec 26, 2009, at 3:10 PM, Wensui Liu wrote: i am just wondering if there is an effective way to include other external codes into the program.

Re: [R] [GGPLOT] Legends at different layers

2009-12-26 Thread Megh
Hi Hadley, recently I run this code however got following error (this error seems not be there at 1st time) : dat - data.frame(x = rnorm(100)) dat1 - data.frame( + x = c(0,0), + y = c(1,0), + Label = c(Point1, Point2) + ) ggplot(dat, aes(x)) + + geom_histogram(aes(fill

Re: [R] [BioC] How to do RMA without summary to probeset level?

2009-12-26 Thread Max Kuhn
You'll need to use calls to bg.correct and the other functions in sequence and save the probe values along the way. See the example in ?normalize.AffyBatch.normalize2Reference in the caret package. Also, don't email R help about this. Keep it on the bioC mailing list. Max On Sat, Dec 26, 2009

Re: [R] Question regarding if statement in while loop

2009-12-26 Thread Carl Witthoft
Sounds like what you want is either try() or trycatch() -- check out the documentation. Basically, putting your eblest() function inside a try() call allows you to return an error message if eblest crashes without crashing your main loop. BTW, for debugging purposes, I'd recommend

Re: [R] Is there a problem with lattice axes?

2009-12-26 Thread Ted Harding
Thanks, Dennis, that does it! And, now that you have pointed it out, I finally found that particular case lurking deep in ?xyplot. This still leaves the question: When the (default) same is used, why does histogram() plot the bar-heights as if free had been used? The result is that all but one of

Re: [R] Is there a problem with lattice axes?

2009-12-26 Thread Ted Harding
OK, I take it all back (See original below). I had overlooked A: That the Y Label for the histograms I drew was Percent of Total, and that there is a parameter 'type for which type=percent is the default. B: That the histograms I used as an example had N=100 for the case with largest N,

Re: [R] Is SEM package of R suitable for sem analysis

2009-12-26 Thread Reeyarn_李智洋_10928113
Dear Bruno and Joe, Thanks for advising! Reeyarn On Sat, Dec 26, 2009 at 9:32 PM, Bruno Falissard falissar...@wanadoo.fr wrote: A few years ago it could have been true, but now the package has improved (especially with the bootstrap procedure). At the moment there is no argument to

Re: [R] Multiple CHOLMOD errors when attempting poisson glmm

2009-12-26 Thread Gabor Grothendieck
On Sat, Dec 26, 2009 at 1:21 PM, Marielle Postava-Davig postava-davi...@husky.neu.edu wrote: I was actually curious if there was another version of lme4 I could use. You could try glmmPQL in the MASS package. __ R-help@r-project.org mailing list

Re: [R] Is SEM package of R suitable for sem analysis

2009-12-26 Thread Joe King
Your welcome, I wanted to say I agree with Bruno that the comparative software is very expensive, even more prohibitively so for students and even though MPlus is good I think R will catch up rapidly and even overtake those as people who use these modeling techniques become more integrated into

Re: [R] How to manipulate tables

2009-12-26 Thread David Winsemius
On Dec 26, 2009, at 4:56 PM, James Rome wrote: Thanks David. I wanted to calculate the Poisson distribution from my histograms to see how closely they match it. So the formula is something like pprob=((lambda**cnts)/factorial(cnts))*exp(lambda) (Please don't reply privately.) You have

Re: [R] Is SEM package of R suitable for sem analysis

2009-12-26 Thread Wincent
Besides sem package, OpenMx (http://openmx.psyc.virginia.edu/) is another option for R users. Best 2009/12/27 Joe King j...@joepking.com: I am going to take SEM this next quarter in my doctoral program. My suggestion is to use the program your professor suggests and try to re-create your

Re: [R] [ how can sample from f(x)~x^(a-1)

2009-12-26 Thread GlenB
khazaei said: how can sample from f(x)~x^(a-1)*ind(0,min(b,-log(u)) in R? where a and b is positive constand and 0u1 It looks like you've mixed together part of the deensity of a random variable and part of a method of generating one. Is u a fixed quantity or a random uniform? What is