[R] Modify base R functions in Rprofile.site

2009-10-03 Thread Yihui Xie
Hi everyone, I want to modify two base R functions 'parse' and 'deparse' immediately after R has started, so I added some code in the file 'Rprofile.site' under the 'etc' directory. Here is a simple example: parse=function(...){ base::parse(...) } I'll get an error when I start R as follows:

Re: [R] offlist Re: AW: Urgently needed Exercise solutions related to PracticalData Analysis Using R Statisctial Software

2009-10-03 Thread Daniel Malter
Accepted and forgotten. It just reminds us to check on our prejudices once in a while. Also, I realized that my description was not entirely accurate. You actually had to click the link on the page you posted to get this: http://www.odesk.com/jobs/College-Assistance_~~dd7622f6bdef9177 I am an MSc

Re: [R] Stranger Behavior -maybe not

2009-10-03 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Antonio Paredes > Sent: Saturday, October 03, 2009 5:53 PM > To: r-help@r-project.org > Subject: [R] Stranger Behavior -maybe not > > Hello everyone, > > When I run a for loop I

Re: [R] Tabulating using arbitrary numbers of factors

2009-10-03 Thread Jim Lemon
On 10/03/2009 04:15 AM, Andrew Spence wrote: Dear R-help, First of all, thank you VERY much for any help you have time to offer. I greatly appreciate it. I would like to write a function that, given an arbitrary number of factors from a data frame, tabulates the number of occurrences of eac

[R] multicore - no parallel

2009-10-03 Thread dunno87
Hi everyone, Thanks for the help in advance. I just want to know if there is absolutely any way of using multicore if my loop can't run in parallel as each iteration depends on the previous iteration. I have Windows R 2.9.2 and REvolution R Enterprise 2.0 for Windows 64 bit. I also have if necess

Re: [R] Paste a character to an object

2009-10-03 Thread David Winsemius
On Oct 3, 2009, at 11:14 PM, Tim Clark wrote: David, Thanks, that helps me in making an example of what I am trying to do. Given the following example, I would like to run through a for loop and obtain a vector of the data only for the 100, 75, and 50 percent values. Is there a way to

Re: [R] Stranger Behavior -maybe not

2009-10-03 Thread Don McKenzie
Yes of course. I was sticking to R. On 3-Oct-09, at 7:42 PM, hadley wickham wrote: The point Duncan was making was "What other value would you expect it to have after incrementing from 1 to 200 and stopping"? Well, depending on the scoping rules of the language you are used to, you migh

Re: [R] Urgently needed Exercise solutions related to PracticalData Analysis Using R Statisctial Software

2009-10-03 Thread Daniel Malter
This person has probably mistaken "expelsior" for "excelsior." However, be that as it may, I am personally annoyed by your statement, David, in which you indicate that you believe this to be an MBA/business school problem, especially since the delinquent clearly indicates in his post - for which

Re: [R] Paste a character to an object

2009-10-03 Thread Tim Clark
David, Thanks, that helps me in making an example of what I am trying to do. Given the following example, I would like to run through a for loop and obtain a vector of the data only for the 100, 75, and 50 percent values. Is there a way to get this to work, either using paste as in the exampl

Re: [R] Paste a character to an object

2009-10-03 Thread David Winsemius
On Oct 3, 2009, at 10:26 PM, Tim Clark wrote: Dear List, I can't seem to get a simple paste function to work like I need. I have an object I need to call but it ends in a character string. The object is a list of home range values for a range of percent isopleths. I need to loop throu

Re: [R] Stranger Behavior -maybe not

2009-10-03 Thread hadley wickham
> The point Duncan was making was > > "What other value would you expect it to have after incrementing from 1 to > 200 and stopping"? Well, depending on the scoping rules of the language you are used to, you might expect i at the top-level to remain undefined. Hadley -- http://had.co.nz/ _

Re: [R] Stranger Behavior -maybe not

2009-10-03 Thread Don McKenzie
The point Duncan was making was "What other value would you expect it to have after incrementing from 1 to 200 and stopping"? On 3-Oct-09, at 6:39 PM, Antonio Paredes wrote: Thank you very much!!! Next time, if I know you are going to read the e-mail; I make sure to include an explanation

Re: [R] update'ing trellis object

2009-10-03 Thread David Winsemius
On Oct 3, 2009, at 7:05 PM, Sebastian P. Luque wrote: Hi, I thought the following would only remove the legend element of a trellis object, but it actually removes both the legend and key elements: ------ fig <- xyplot(Se

[R] Paste a character to an object

2009-10-03 Thread Tim Clark
Dear List, I can't seem to get a simple paste function to work like I need. I have an object I need to call but it ends in a character string. The object is a list of home range values for a range of percent isopleths. I need to loop through a vector of percent values, so I need to paste the

Re: [R] Urgently needed Exercise solutions related to Practical Data Analysis Using R Statisctial Software

2009-10-03 Thread Gabor Grothendieck
Mark had intended to send the message below but due to a technical problem only a blank message appeared on r-help: David: I'm on the moderator list that checks which non subscriber emails go through. I confess to letting that one through because I figured it was better for the person to receive t

Re: [R] Numerical.summary Error

2009-10-03 Thread Rene
Dear all, Have you experienced problem of using numerical.summary() function? I used to be able to run this function in R, but not any more. Now I try to use this function, it gives me error like this: Error: could not find function "numerical.summary" I used to be able to run this fu

Re: [R] Urgently needed Exercise solutions related to Practical Data Analysis Using R Statisctial Software

2009-10-03 Thread markleeds
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Urgently needed Exercise solutions related to Practical Data Analysis Using R Statisctial Software

2009-10-03 Thread David Winsemius
On Oct 3, 2009, at 8:31 PM, Mahesh Krishnan wrote: Hello, Can anybody help me in solving these exercises on regular basis paid or unpaid basis. If he/she want to pay by PayPal then it should be noticed that mention at this email kindly your paypal email account where one can transfer mon

Re: [R] Stranger Behavior -maybe not

2009-10-03 Thread Antonio Paredes
Thank you very much!!! Next time, if I know you are going to read the e-mail; I make sure to include an explanation in the form of an answer to any issue that I'm inquiring about. On Sat, Oct 3, 2009 at 9:17 PM, Duncan Murdoch wrote: > On 03/10/2009 8:53 PM, Antonio Paredes wrote: > >> Hel

Re: [R] Stranger Behavior -maybe not

2009-10-03 Thread Duncan Murdoch
On 03/10/2009 8:53 PM, Antonio Paredes wrote: Hello everyone, When I run a for loop I noticed that the looping variable gets assigned the last value in the loop: For example, if I let h=200, and I run for(i in 1:h), i gets the value 200. What's wrong here? Nothing? Duncan Murdoch

[R] update'ing trellis object

2009-10-03 Thread Sebastian P. Luque
Hi, I thought the following would only remove the legend element of a trellis object, but it actually removes both the legend and key elements: ------ fig <- xyplot(Sepal.Length ~ Petal.Length, groups=Species, data=iris,

[R] Urgently needed Exercise solutions related to Practical Data Analysis Using R Statisctial Software

2009-10-03 Thread Mahesh Krishnan
Hello, Can anybody help me in solving these exercises on regular basis paid or unpaid basis. If he/she want to pay by PayPal then it should be noticed that mention at this email kindly your paypal email account where one can transfer money in all cases. But please respect the deadline in al cases

[R] Stranger Behavior -maybe not

2009-10-03 Thread Antonio Paredes
Hello everyone, When I run a for loop I noticed that the looping variable gets assigned the last value in the loop: For example, if I let h=200, and I run for(i in 1:h), i gets the value 200. What's wrong here? -- -Tony [[alternative HTML version deleted]] __

Re: [R] converting matrix of lists to a regular matrix

2009-10-03 Thread Andrew Yee
Thanks, as you suggested, do.call(rbind, lapply(foo, unlist)) does the trick. On Sat, Oct 3, 2009 at 8:30 PM, David Winsemius wrote: > > On Oct 3, 2009, at 7:51 PM, Andrew Yee wrote: > > Take the following code: >> foo <- list() >> >> foo[[1]] <- list(a=1, b=2) >> foo[[2]] <- list(a=11, b=22) >

Re: [R] converting matrix of lists to a regular matrix

2009-10-03 Thread David Winsemius
On Oct 3, 2009, at 7:51 PM, Andrew Yee wrote: Take the following code: foo <- list() foo[[1]] <- list(a=1, b=2) foo[[2]] <- list(a=11, b=22) foo[[3]] <- list(a=111, b=222) Instead, perhaps: > do.call(rbind, lapply(foo, unlist)) a b [1,] 1 2 [2,] 11 22 [3,] 111 222 > do.call

Re: [R] converting matrix of lists to a regular matrix

2009-10-03 Thread Gabor Grothendieck
The object out in my post is identical to the object, result, in your post. If that was not what you are looking for some additional explanation is needed on what it is that you seek. > M <- matrix(list(1, 11, 111, 2, 22, 222), nc = 2, dimnames = list(NULL, > c("a", "b"))) > > foo <- list() > >

Re: [R] converting matrix of lists to a regular matrix

2009-10-03 Thread Andrew Yee
Gabor, thanks for the reply. However, the output of matrix(list(1, 11, 111, 2, 22, 222), nc = 2, dimnames = list(NULL, c("a", "b"))) is a matrix of lists. foo <- matrix(list(1, 11, 111, 2, 22, 222), nc = 2, dimnames = list(NULL, c("a", "b"))) foo[,'a'] # returns a list One possible solution is as

Re: [R] converting matrix of lists to a regular matrix

2009-10-03 Thread Gabor Grothendieck
Try this: matrix(list(1, 11, 111, 2, 22, 222), nc = 2, dimnames = list(NULL, c("a", "b"))) or out <- list(1, 11, 111, 2, 22, 222) dim(out) <- c(3, 2) colnames(out) <- c("a", "b") On Sat, Oct 3, 2009 at 7:51 PM, Andrew Yee wrote: > Take the following code: >  foo <- list() > > foo[[1]] <- list

[R] converting matrix of lists to a regular matrix

2009-10-03 Thread Andrew Yee
Take the following code: foo <- list() foo[[1]] <- list(a=1, b=2) foo[[2]] <- list(a=11, b=22) foo[[3]] <- list(a=111, b=222) result <- do.call(rbind, foo) result[,'a'] In this case, result[,'a'] shows a list. Is there a more elegant way such that result is a "regular" matrix of vectors? I imag

[R] update'ing trellis object

2009-10-03 Thread Sebastian P. Luque
Hi, I thought the following would only remove the legend element of a trellis object, but it actually removes both the legend and key elements: fig <- xyplot(Sepal.Length ~ Petal.Length, groups=Species, data=iris, key=list(x=1, y=0.02, corner=c(1, 0), size=3, between=1,

Re: [R] Optim Problem??

2009-10-03 Thread Duncan Murdoch
On 03/10/2009 5:26 PM, Jim Silverton wrote: I have having the following error message when trying to optimize a function using optim: optim(c(10,100),fn,method="BFGS") Error in optim(c(10, 100), fn, method = "BFGS") : cannot coerce type 'S4' to vector of type 'double' Can someone tell me

Re: [R] Optim Problem??

2009-10-03 Thread Jim Silverton
I have having the following error message when trying to optimize a function using optim: > optim(c(10,100),fn,method="BFGS") Error in optim(c(10, 100), fn, method = "BFGS") : cannot coerce type 'S4' to vector of type 'double' > Can someone tell me what this means? Jim [[alternative

Re: [R] trouble with html() in Hmisc

2009-10-03 Thread Liviu Andronic
(I am also cc-ing the author of Hmisc) Hello Thank you for clearing this up. One more concern, though. On 10/3/09, Mark Difford wrote: > >> Does this mean that Hmisc produces LyX code (as opposed to LaTeX code)? > No. Sorry for confusing you: it means that html does not know what > tabularnewli

Re: [R] if else statement error

2009-10-03 Thread Duncan Murdoch
On 03/10/2009 3:33 PM, Marianne Promberger wrote: Two problems with your code: (1) The "else" has to be on the same line as the closing "}" -- this was confusing for me as well. (2) "and" probably should be "&", but read up on logical operators: ?& Better to always use && in an if. Duncan M

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-03 Thread David Winsemius
If you look at layout's help page there appears to be a worked example of an even more complex task. The answer appears to be assingning numbers to regions and then inserting par(mar= with an appropriately constructed destination arguments prior to each added piece. -- David On Oct 3, 200

Re: [R] if else statement error

2009-10-03 Thread Marianne Promberger
Two problems with your code: (1) The "else" has to be on the same line as the closing "}" -- this was confusing for me as well. (2) "and" probably should be "&", but read up on logical operators: ?& Try: ini=3 b=4 if (ini==1) { a=3 } else if (ini>1 & b>2 ) { a=3 } else { a=6 } HTH, Ma

[R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-03 Thread Marianne Promberger
Dear R users, I create a graphic with two plots side by side using layout(), like this: layout(matrix(c(1,2),1)) plot(1:10,main="left plot") lines(c(3:7,7:3),col="red") plot(10:1,main="right plot") The lines() obivously get added to the "left plot" plot. Now, I'm trying to write a function that

Re: [R] Winbugs under R's error message

2009-10-03 Thread Gabor Grothendieck
On Sat, Oct 3, 2009 at 2:57 PM, LinZhongjun wrote: > > The reason may be that I used a vista machine. I tried on a XP machine, and > there were no error messages.. > Try right clicking on the R icon on your desktop and choose Run as Adminstrator and see if that helps. _

Re: [R] Passing lists and R memory usage growth

2009-10-03 Thread Rajeev Ayyagari
Duncan: I took your suggestion and upgraded to R 2.9.2, but the problem persists. I am not able to reproduce the problem in a simple case. In my actual code the functions some.function.1() and some.function.2() are quite complicated and call various other functions which also access elements of

Re: [R] Winbugs under R's error message

2009-10-03 Thread LinZhongjun
The reason may be that I used a vista machine. I tried on a XP machine, and there were no error messages.. > Date: Sat, 3 Oct 2009 11:49:25 +0200 > From: lig...@statistik.tu-dortmund.de > To: lin_zhong...@hotmail.com > CC: r-help@r-project.org > Subject: Re: [R] Winbugs under R's error messa

Re: [R] Robust ANOVA with variance heterogeneity

2009-10-03 Thread David Winsemius
Do you have a citation for that statement? I cannot convince myself that it should be true. After looking at the CRAN Task View, I would suggest the OP look at rlm(MASS) or lmrob(robustbase). -- David On Oct 2, 2009, at 11:05 AM, Kjetil Halvorsen wrote: On Fri, Oct 2, 2009 at 8:45 AM, Da

Re: [R] trouble with html() in Hmisc

2009-10-03 Thread Mark Difford
Liviu, >> Does this mean that Hmisc produces LyX code (as opposed to LaTeX code)? No. Sorry for confusing you: it means that html does not know what tabularnewline means, it cannot interpret it. My reply showed where the problem lies and how to fix it. You need to add the following command to t

Re: [R] trouble with html() in Hmisc

2009-10-03 Thread Liviu Andronic
Hello On 10/3/09, Mark Difford wrote: > This has nothing to do with Hmisc or hevea. > Although I have LyX installed, I don't quite understand where LyX comes into play. The R code in the original e-mail takes a table-like object and transforms it into LaTeX; then html() calls hevea to conver .tex

Re: [R] Passing lists and R memory usage growth

2009-10-03 Thread Duncan Murdoch
You need to give reproducible code for a question like this, not pseudocode. And you should consider using a recent version of R, not the relatively ancient 2.8.1 (which was released in late 2008. Duncan Murdoch On 03/10/2009 1:30 PM, Rajeev Ayyagari wrote: Hello, I can't think of an explan

Re: [R] Multiple time series and their names

2009-10-03 Thread David Stoffer
That info along with drop=FALSE seems to be a reasonable hack. Thanks again- David Gabor Grothendieck wrote: > > You can use names using your example ts series like this > > x[, "Juan"] > > > On Sat, Oct 3, 2009 at 11:04 AM, David Stoffer > wrote: >> >> Thanks for the help.  My basic prob

[R] Passing lists and R memory usage growth

2009-10-03 Thread Rajeev Ayyagari
Hello, I can't think of an explanation for this memory allocation behaviour and was hoping someone on the list could help out. Setup: -- R version 2.8.1, 32-bit Ubuntu 9.04 Linux, Core 2 Duo with 3GB ram Description: Inside a for loop, I am passing a list to a function. The f

Re: [R] else if statement error

2009-10-03 Thread Duncan Murdoch
On 03/10/2009 11:54 AM, Chen Gu wrote: Hello, I am doing a simple if else statement in R. But it always comes out error such as 'unexpected error' There are two variables. ini and b. when ini=1, a=3; when ini>1 and b>2, a=5; all other situations, a=6. I don't know where it is wrong. Here is my c

Re: [R] else if statement error

2009-10-03 Thread David Winsemius
On Oct 3, 2009, at 11:54 AM, Chen Gu wrote: Hello, I am doing a simple if else statement in R. But it always comes out error such as 'unexpected error' There are two variables. ini and b. when ini=1, a=3; when ini>1 and b>2, a=5; all other situations, a=6. I don't know where it is wrong.

Re: [R] else if statement error

2009-10-03 Thread Benilton Carvalho
align the 'else if' and 'else' with the closing curly brackets. if (condA){ doStuff() } else if (condB){ doOtherStuff() } else { doWhatever() } b On Oct 3, 2009, at 12:54 PM, Chen Gu wrote: Hello, I am doing a simple if else statement in R. But it always comes out error such as 'une

[R] if else statement error

2009-10-03 Thread gcheer3
Hello, I am doing a if else statement in R. But it always comes out error such as 'unexpected symbol' There are two variables. ini and b. when ini=1, a=3; when ini>1 and b>2, a=3; all other situations, a=6. I don't know where it is wrong. Here is my code ini=3 b=4 if (ini==1) { a=3

[R] else if statement error

2009-10-03 Thread Chen Gu
Hello, I am doing a simple if else statement in R. But it always comes out error such as 'unexpected error' There are two variables. ini and b. when ini=1, a=3; when ini>1 and b>2, a=5; all other situations, a=6. I don't know where it is wrong. Here is my code ini=3 b=4 if (ini==1) { a=3

Re: [R] Calculating the average after adding 3 matrices

2009-10-03 Thread Sarah Goslee
Well, yes: add them up and divide by 3. What did you try that didn't work? Sarah On Sat, Oct 3, 2009 at 12:06 PM, ANJAN PURKAYASTHA wrote: > Hi all, > Here is my problem: >  I have 3 matrices , A, B, C. > Each is an nXn matrix. > I need to create matrix D such that : D[i,j]= (A[i,j]+B[i,j]+C[i,

Re: [R] Calculating the average after adding 3 matrices

2009-10-03 Thread Ondrej Vozar
You can just do D<-(A+B+C)/3. Best regards, Ondrej. On 03/10/2009, ANJAN PURKAYASTHA wrote: > > Hi all, > Here is my problem: > I have 3 matrices , A, B, C. > Each is an nXn matrix. > I need to create matrix D such that : D[i,j]= (A[i,j]+B[i,j]+C[i,j])/3. > Being a newbie this is proving to be a

[R] How to show clustering results?

2009-10-03 Thread Peng Yu
Hi, I know the following code can show the dendrogram. But I also want to plot the points on a figure and have circles (or boxes) around the points in a cluster (see http://www.autonlab.org/tutorials/kmeans11.pdf for some examples). I am wondering how to do so in R. Regards, Peng x1 = c(0,0) x2

[R] Calculating the average after adding 3 matrices

2009-10-03 Thread ANJAN PURKAYASTHA
Hi all, Here is my problem: I have 3 matrices , A, B, C. Each is an nXn matrix. I need to create matrix D such that : D[i,j]= (A[i,j]+B[i,j]+C[i,j])/3. Being a newbie this is proving to be a challenge. Any ideas on how best to accomplish this? Thanks! Anjan -- = anja

Re: [R] Multiple time series and their names

2009-10-03 Thread Gabor Grothendieck
You can use names using your example ts series like this x[, "Juan"] On Sat, Oct 3, 2009 at 11:04 AM, David Stoffer wrote: > > Thanks for the help.  My basic problem is that I have given my series names, > but I still have to call them number 1, 2, and so on, to do things with > them.  If I wa

Re: [R] Debug

2009-10-03 Thread David Winsemius
On Oct 1, 2009, at 11:04 AM, Tammy Ma wrote: provide commented, minimal, self-contained, reproducible code. David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

[R] gregmisc library (Mandriva)

2009-10-03 Thread chi ball
Hi, I'm not able to find a rpm of "gregmisc" library (>2.0.0) for Linux Mandriva 2008 Spring. Any suggestion? Thanks _ [[elided Hotmail spam]] [[alternative HTML version deleted]

Re: [R] Multiple time series and their names

2009-10-03 Thread David Stoffer
Thanks for the help. My basic problem is that I have given my series names, but I still have to call them number 1, 2, and so on, to do things with them. If I want to compare "GNP" with "Private Investment", I have to remember which columns contains those series. The concern I have is that I'm

Re: [R] error using frailty term

2009-10-03 Thread Terry Therneau
--- begin included message - T rying to fit a model using the Surv() with a frailty term but get the following cryptic error message: -- Error in frailty.brent(sqrt(x), y, lower = 0) : Ties for max(y), I surrender Cal

Re: [R] Weibull survival regression model with different shape parameters

2009-10-03 Thread Terry Therneau
--- begin included message --- I'm trying to fit a parametric survival model using the survreg function with a Weibull distribution. I'm studying the time to death of individuals from different families and I would like to fit different shape parameters (ie 1/scale in R) for each of the familie

Re: [R] trouble with html() in Hmisc

2009-10-03 Thread Mark Difford
Hi Liviu, >> > tmp <- latex(.object, cdec=c(2,2), title="") >> > class(tmp) >> [1] "latex" >> > html(tmp) >> /tmp/RtmprfPwzw/file7e72f7a7.tex:9: Warning: Command not found: >> \tabularnewline >> Giving up command: \...@hevea@amper >> /tmp/RtmprfPwzw/file7e72f7a7.tex:11: Error while reading

Re: [R] Winbugs under R's error message

2009-10-03 Thread Polwart Calum (County Durham and Darlington NHS Foundation Trust)
>LinZhongjun wrote: >> > >I ran Winbugs under R. I could get the results, but I kept getting the error > >messages: >> > >Error in > > file(con, "wb") : cannot open the connection > >In addition: Warning messages: > >1: In file.c

[R] Hierarchical partitioning built upon a GAM modelling framework?

2009-10-03 Thread Clément Tisseuil
Dear R community, The hier.part package applies hierarchical partitioning based upon a GLM (generalized linear model) framework to assess the independent and joint effect from a set of predictors onto a single quantitative response variable. Conceptually and from a statistical point of view, are t

Re: [R] Winbugs under R's error message

2009-10-03 Thread Uwe Ligges
Why do you post twice? ANway, same answer as before: You probably do not have write permissions for those WinBUGS files that R2WinBUGS tries to rewrite. Uwe Ligges LinZhongjun wrote: Dear R lists, I ran Winbugs under R. I could get the results, but I kept getting the error messages:

Re: [R] Why do I have the error message?

2009-10-03 Thread Uwe Ligges
LinZhongjun wrote: Dear R lists, I ran Winbugs under R. I could get the results, but I kept getting the error messages: Error in file(con, "wb") : cannot open the connection In addition: Warning messages: 1: In file.cr

Re: [R] getting variables based on name

2009-10-03 Thread William Doane
This turns out to be quite easy... Given: > head(data) inst a1 a2 a3 a4 a5 a6 a7 a8 escore 11 1 1 0 1 1 0 0 0 4 21 0 1 0 0 0 0 0 0 1 31 1 0 0 1 0 1 1 1 2 41 0 1 0 0 0 1 0 0 1 You can use grep on the names of the columns in d

Re: [R] getting variables based on name

2009-10-03 Thread Rnewb
thanks very much for the quick and accurate response! Rnewb -- View this message in context: http://www.nabble.com/getting-variables-based-on-name-tp25725837p25726184.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.o

[R] Winbugs under R's error message

2009-10-03 Thread LinZhongjun
Dear R lists, I ran Winbugs under R. I could get the results, but I kept getting the error messages: Error in file(con, "wb") : cannot open the connection In addition: Warning messages: 1: In file.create(to[okay]) : cann

[R] Why do I have the error message?

2009-10-03 Thread LinZhongjun
Dear R lists, I ran Winbugs under R. I could get the results, but I kept getting the error messages: Error in file(con, "wb") : cannot open the connection In addition: Warning messages: 1: In file.create(to[okay]) : cann

[R] getting variables based on name

2009-10-03 Thread Rnewb
I have a file like this: a1,a2,a3,b1,b2,b3 1,2,3,4,5,6 0,1,2,3,4,5 ... In interactive command-line R, I type data<-read.table('file.txt', sep=',', header=TRUE) I then want to get all the columns which start with the letter a. For this particular file, I can the type: data[1:3] What if i don