[R] R 2.14.0 Design library

2012-01-04 Thread Bonnett, Laura
Dear all, I have recently upgraded to R 2.14.0 with Windows 7. I wish to use the command 'cph' but the Design library is no longer on the list of installable packages. How can I install Design so that I may use the 'cph' function? Many thanks, Laura [[alternative HTML version

Re: [R] R 2.14.0 Design library

2012-01-04 Thread Milan Bouchet-Valat
Le mercredi 04 janvier 2012 à 09:04 +, Bonnett, Laura a écrit : Dear all, I have recently upgraded to R 2.14.0 with Windows 7. I wish to use the command 'cph' but the Design library is no longer on the list of installable packages. How can I install Design so that I may use the 'cph'

Re: [R] R 2.14.0 Design library

2012-01-04 Thread Bonnett, Laura
Thank you! -Original Message- From: Milan Bouchet-Valat [mailto:nalimi...@club.fr] Sent: 04 January 2012 09:23 To: Bonnett, Laura Cc: 'r-help@r-project.org' Subject: Re: [R] R 2.14.0 Design library Le mercredi 04 janvier 2012 à 09:04 +, Bonnett, Laura a écrit : Dear all, I have

[R] Extract concordance from coxph.object

2012-01-04 Thread Bonnett, Laura
Dear all, As I said in my previous email I have just upgraded to R 2.14.0 on Windows 7. I have just run the 'coxph' function and notice that a Concordance statistic is produced. Is there any way to extract this information from the output? E.g. can I call the concordance value independently

Re: [R] About source()

2012-01-04 Thread Uwe Ligges
On 03.01.2012 21:22, Li SUN wrote: Thanks, Rolf, Justin and Uwe! Actually I wanted to run .R file as a script, just like what people do for bash scripts or python scripts. It seems to me that adding #!/usr/bin/R -f at the first line is what I need. Is this true? Perhaps even Rscript rather

Re: [R] tcltk on linux/rhel6

2012-01-04 Thread Prof Brian Ripley
On 04/01/2012 01:52, Peter Langfelder wrote: On Tue, Jan 3, 2012 at 4:03 PM, Carl Baribaultcrlbr...@gmail.com wrote: Dear All, I've seen posts to the effect that.. 1) choose.dir is only available for windows, and 2) tk_choose.dir would be the linux equivalent. I'm still having trouble with

Re: [R] About source()

2012-01-04 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/01/12 10:39, Uwe Ligges wrote: On 03.01.2012 21:22, Li SUN wrote: Thanks, Rolf, Justin and Uwe! Actually I wanted to run .R file as a script, just like what people do for bash scripts or python scripts. It seems to me that adding

Re: [R] Extract concordance from coxph.object

2012-01-04 Thread Milan Bouchet-Valat
Le mercredi 04 janvier 2012 à 09:27 +, Bonnett, Laura a écrit : Dear all, As I said in my previous email I have just upgraded to R 2.14.0 on Windows 7. I have just run the 'coxph' function and notice that a Concordance statistic is produced. Is there any way to extract this

[R] KS and AD test for Generalized PAreto and Generalized Extreme value

2012-01-04 Thread Vincy Pyne
Dear R helpers, I need to use KS and AD test for Generalized Pareto and Generalized extreme value. E.g. if I need to use KS for Weibull, I have teh syntax ks.test(x.wei,pweibull, shape=2,scale=1) Similarly, for AD I use ad.test(x, distr.fun, ...) My problem is fir given data, I have

Re: [R] An R interface to Model Building

2012-01-04 Thread Yvonnick Noel
Brett, Spencer, I replied to Brett on the R-SIG-GUI mailing list, suggesting to use the proto package. I found it most useful to structure the code when developing my R2STATS interface. 2. Have you reviewed the other R projects with a graphical user interface for R? Several are

[R] A problem of meta analysis based on metafor package

2012-01-04 Thread XUT
I would like to make a meta analysis based on metafor package. If I only have the data of RR, 95%CI of every study, could I finish the meta analysis? If possible, how to do it? Millions of thanks! -- View this message in context:

[R] Linear regression using matrices

2012-01-04 Thread Mark Sanderson
I'm new to R and I'm not a Statistician I'm an Accountant, but I'm finding it an excellent tool for the business analysis work I do. I need to run LM() where both response and predictor are held in matrices. The model follows the form:- regression1 = matrix1.col1 - matrix2.col1 regression2 =

Re: [R] problem in R

2012-01-04 Thread iliketurtles
data-matrix(rnorm(10)) data[c(1,4,6)]-NA print(data) data-matrix(data[!is.na(data)]) print(data) - Isaac Research Assistant Quantitative Finance Faculty, UTS -- View this message in context: http://r.789695.n4.nabble.com/problem-in-R-tp4260254p4260976.html Sent from the R help mailing

[R] Error formal argument softmax matched by multiple actual arguments

2012-01-04 Thread Yashwanth M.R
I am running the nnet package as neural.soft-nnet(custcat~region+ed+marital+tenure+age+address+income,size=3,softmax=TRUE) This returns the error message : formal argument softmax matched by multiple actual arguments Here the dependent variable custcat is a factor with 4-levels. This

Re: [R] Linear regression using matrices

2012-01-04 Thread iliketurtles
I've done a lot of research on this very topic and found a few solutions. But all the ways I've discovered involve loops. Applying it to what you want, the best way I've found is to do (stolen from an experienced R user, of course): y-array(rnorm(100),dim=c(10,10))

Re: [R] RODBC installation: error message

2012-01-04 Thread Duncan Murdoch
On 12-01-03 2:39 PM, gregory benison wrote: If one attempts to install RODBC (via install.packages('RODBC')) without having an ODBC driver installed, this error message results: checking sqlext.h presence... no checking for sqlext.h... no configure: error: ODBC headers sql.h and sqlext.h not

Re: [R] R 2.14.0 Design library

2012-01-04 Thread Frank Harrell
See http://biostat.mc.vanderbilt.edu/Rrms for a list of changes that the user needs to deal with, especially with respect to plotting predicted values. Frank Bonnett, Laura wrote Thank you! -Original Message- From: Milan Bouchet-Valat [mailto:nalimilan@] Sent: 04 January 2012

[R] Using a mathematical expression in sapply() XXXX

2012-01-04 Thread Dan Abner
Hello everyone, I have the following call to sapply() and error message. Is the most efficient way to deal with this to make sum(!is.na(x)) a function in a separate line prior to this call? If not, please advise. N.Valid=sapply(x,sum(!is.na(x))) Error in match.fun(FUN) : 'sum(!is.na(x))' is

Re: [R] Using a mathematical expression in sapply() XXXX

2012-01-04 Thread Milan Bouchet-Valat
Le mercredi 04 janvier 2012 à 08:41 -0500, Dan Abner a écrit : Hello everyone, I have the following call to sapply() and error message. Is the most efficient way to deal with this to make sum(!is.na(x)) a function in a separate line prior to this call? If not, please advise.

[R] simulating stable VAR process

2012-01-04 Thread statquant2
Hello all, I looking at package dse or vars or mAr I know how to simulate a VAR(p) process, my problem is that most of those processes are unstable (not weakly stationary). Do anybody know how to generate a random VAR (or VARMA even better) process that is weakly stationary? Thanks -- View this

Re: [R] simulating stable VAR process

2012-01-04 Thread statquant2
More specifically. I know that a condition for a VAR(p) process to be stable (weakly stationary) is that the companion form of the equation (see AWESOME Pfaff book analysis of integrated and cointegrated time series in R) as eigenvalues of modulus 1. My problem is that I want to generate such

Re: [R] Using a mathematical expression in sapply() XXXX

2012-01-04 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Jan 4, 2012, at 7:41 AM, Dan Abner dan.abne...@gmail.com wrote: Hello everyone, I have the following call to sapply() and error message. Is the most efficient way to deal with this to make sum(!is.na(x)) a function in a separate line prior to this call? Yes or inline using an

Re: [R] RODBC installation: error message

2012-01-04 Thread Milan Bouchet-Valat
Le mardi 03 janvier 2012 à 11:39 -0800, gregory benison a écrit : If one attempts to install RODBC (via install.packages('RODBC')) without having an ODBC driver installed, this error message results: checking sqlext.h presence... no checking for sqlext.h... no configure: error: ODBC headers

[R] Update method on existing reference class object

2012-01-04 Thread Peder Bacher
Hi Being able to do object oriented programming in R is really good. I now started using the Reference Classes and really like it. Though, I have one problem: I cannot find a way to update a method on an existing object. The flexibility that scripting gives (really needed for interactive data

Re: [R] Using a mathematical expression in sapply() XXXX

2012-01-04 Thread Meyners, Michael
Dan, It depends on what you want to achieve. I suspect you just want to remove missing values before summing; if so, consider sapply(x, sum, na.rm=TRUE) instead. To make your code running, try sapply(x, function(x) sum(!is.na(x))) However, this would just count the number of non-missing

Re: [R] Linear regression using matrices

2012-01-04 Thread Mark Sanderson
OK thanks. In my case I think it might be possible to work around this by reshaping my data and then using lmlist() to run separate regressions for each data group. lmlist() is new to me but it looks like it will do the job. -- View this message in context:

Re: [R] Getting Sphericity Tests for Within Subject Repeated Measure Anova (using car package)

2012-01-04 Thread Michael Friendly
On 1/3/2012 9:36 PM, maximilian.mueller wrote: Here is the syntax: options(contrasts=c(contr.sum, contr.poly)) read.csv2(test21.csv) - dat3 mod3 - lm(cbind(umsatz_t1, umsatz_t2, umsatz_t3, umsatz_t4) + cbind(ebitda_t1, ebitda_t2, ebitda_t3, ebitda_t4) + ~ 1, data=dat3) idata3 -

Re: [R] Using a mathematical expression in sapply() XXXX

2012-01-04 Thread peter dalgaard
On Jan 4, 2012, at 14:57 , Milan Bouchet-Valat wrote: Le mercredi 04 janvier 2012 à 08:41 -0500, Dan Abner a écrit : Hello everyone, I have the following call to sapply() and error message. Is the most efficient way to deal with this to make sum(!is.na(x)) a function in a separate line

Re: [R] KS and AD test for Generalized PAreto and Generalized Extreme value

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 5:49 AM, Vincy Pyne wrote: Dear R helpers, I need to use KS and AD test for Generalized Pareto and Generalized extreme value. When I searched on these names Generalized Pareto and Generalized extreme value I got plenty of hits (over 90 in one case and over 100 in

Re: [R] RODBC installation: error message

2012-01-04 Thread Marc Schwartz
On Jan 4, 2012, at 8:02 AM, Milan Bouchet-Valat wrote: Le mardi 03 janvier 2012 à 11:39 -0800, gregory benison a écrit : If one attempts to install RODBC (via install.packages('RODBC')) without having an ODBC driver installed, this error message results: checking sqlext.h presence... no

[R] Warning message about closing a connection XXXX

2012-01-04 Thread Dan Abner
Hello everyone, After running the following code, I obtain this error message. mydata - read.table(textConnection(mystring), +header=TRUE, sep=,, +row.names=id, na.strings= ) mydata Warning message: closing unused connection 3 (mystring) = However, when I attempt to run

Re: [R] Warning message about closing a connection XXXX

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 9:53 AM, Dan Abner wrote: Hello everyone, After running the following code, I obtain this error message. mydata - read.table(textConnection(mystring), +header=TRUE, sep=,, +row.names=id, na.strings= ) mydata Warning message: closing unused connection 3

Re: [R] Getting Sphericity Tests for Within Subject Repeated Measure Anova (using car package)

2012-01-04 Thread John Fox
Dear Max, I'm having a little trouble following what you did and am also confused by the subject of your posting. Is this a response to another message? Is it really about getting sphericity tests? In addition: (1) Why are you adding together the response matrices cbind(umsatz_t1, umsatz_t2,

[R] Is there a way to update a method on an existing Reference Class object?

2012-01-04 Thread Peder Bacher
Hi Being able to do object oriented programming in R is really good. I now started using the Reference Classes and really like it. Though, I have one problem: I cannot find a way to update a method on an existing object. The flexibility that scripting gives (really needed for interactive data

[R] [Matlab] Need help on ARIMA and Matlab

2012-01-04 Thread Antonio Tirri
Hi, I have to forecast some value of a time series using an ARIMA(5,1,3) model. I saw in Matlab there isn't a function for ARIMA models because ARIMA models are a type of Box-Jenkins models. But how to set parameters? In the Box-Jenkins models m = bj(data,[nb nc nd nf nk]) How to set nb, nc,

[R] subscript with comma

2012-01-04 Thread suse
Hi, I want to write a word with subscript in a graph. Unfortunately, the subscript contains a comma, so all my trials didn't work and I didn't find how to do it. I want to write sm as normal text and w,grass in the subscript. Can anybody help me? And a more general question: I read the help to

[R] Adding a vertical line to plot with two overlapping density plots

2012-01-04 Thread josh rosen
Hi, A simple question I hope. I wish to add a single vertical line to a plot with several density plots. Here is a simplified example. thedata - data.frame(x1=rnorm(100,1,1),x2=rnorm(100,3,1)) #create data thedata.m-melt(thedata) densityplot(~value, thedata.m,

Re: [R] [Matlab] Need help on ARIMA and Matlab

2012-01-04 Thread R. Michael Weylandt
Perhaps you are confusedthis is R-help that said, it's very easy with forecast:::forecast.Arima in R Michael On Wed, Jan 4, 2012 at 8:38 AM, Antonio Tirri antonio.ti...@gmail.com wrote: Hi, I have to forecast some value of a time series using an ARIMA(5,1,3) model. I saw in Matlab

Re: [R] Using a mathematical expression in sapply() XXXX

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 9:17 AM, peter dalgaard wrote: On Jan 4, 2012, at 14:57 , Milan Bouchet-Valat wrote: Le mercredi 04 janvier 2012 à 08:41 -0500, Dan Abner a écrit : Hello everyone, I have the following call to sapply() and error message. Is the most efficient way to deal with this to

Re: [R] quadratic programming-maximization instead of

2012-01-04 Thread Ravi Varadhan
Maximizing f(x) = x'Ax makes sense only when A is negative-definite. Therefore, this is the same as minimizing x'Bx, where B = -A, and B is positive-definite. In other words, you should be able to simply flip the sign of the original matrix . This should yield a positive-definite matrix

Re: [R] subscript with comma

2012-01-04 Thread Uwe Ligges
On 04.01.2012 16:12, suse wrote: Hi, I want to write a word with subscript in a graph. Unfortunately, the subscript contains a comma, so all my trials didn't work and I didn't find how to do it. I want to write sm as normal text and w,grass in the subscript. Can anybody help me? And a more

[R] Merging and subsetting with row names XXXX

2012-01-04 Thread Dan Abner
Hello everyone, I have two questions: 1) I want to create a subset of a data frame column-wise and simultaneously extract the row names into a proper variable. I tried this, but received an error: myleft-mydata[c(id=row.names(mydata),workshop,gender,q1,q2)] Error in `[.data.frame`(mydata,

Re: [R] Adding a vertical line to plot with two overlapping density plots

2012-01-04 Thread Petr PIKAL
Hi Hi, A simple question I hope. I wish to add a single vertical line to a plot with several density plots. Here is a simplified example. thedata - data.frame(x1=rnorm(100,1,1),x2=rnorm(100,3,1)) #create data thedata.m-melt(thedata) densityplot(~value, thedata.m,

Re: [R] Merging and subsetting with row names XXXX

2012-01-04 Thread Petr PIKAL
Hi As you did not provide any data you probably can not get canned solution Hello everyone, I have two questions: 1) I want to create a subset of a data frame column-wise and simultaneously extract the row names into a proper variable. I tried this, but received an error:

[R] function in R for my exercise

2012-01-04 Thread Thomthom
Hi R helpers! I have a question. I'm trying to create a function for an exercise. Here are the arguments I should include: x and y are numeric z is a name (plus,minus,multiply,divide) and swap is logical. Here is what the function should do: When z=plus, then x+y is performed and so on for the

Re: [R] Adding a vertical line to plot with two overlapping density plots

2012-01-04 Thread josh rosen
thank you very much Petr. Yes, I meant densityplot form lattice. The code I gave plots the densities of both x1 and x2 in one panel. Could you show me how to integrate the function addline into the code so that a vertical line v=0 is added? On 4 January 2012 15:55, Petr PIKAL

Re: [R] problem in R

2012-01-04 Thread R. Michael Weylandt
I'm not a huge fan of this sort of solution because it doesn't make sense for non-vector-shaped (i.e., matrix or data.frame) data. It only works here because the matrix produced is a special 1xN case. E.g., # Set up some data (and yes, I realize I'm using the trick I'm speaking out against, but

Re: [R] Adding a vertical line to plot with two overlapping density plots

2012-01-04 Thread Petr PIKAL
thank you very much Petr. Yes, I meant densityplot form lattice. The code I gave plots the densities of both x1 and x2 in one panel. Could you show me how to integrate the function addline into the code so that a vertical line v=0 is added? The function is used after you make a plot.

Re: [R] function in R for my exercise

2012-01-04 Thread R. Michael Weylandt
Unfortunately, there's a general no-homework rule because we never know what your instructor wants you to figure out on your own (though, a sincere thanks for admitting this was hw rather than trying to trick us like so many). That said, I think your second function, while a little clumsy, does

[R] putting regression output right on a plot

2012-01-04 Thread Mark Leeds
hi: does anyone know if it's possible and, if so, where there's an example, of putting the output of summary(lm) right on the plot of the data itself. If the answer is to use capture.output and then text, I'll try that but I was thinking there might be an example somewhere ? thanks.

[R] interaction plot and x axis

2012-01-04 Thread Lathouri, Maria
Dear all I am trying to make an interaction plot among 6 variables; e.g. PH to be in the x axis and the rest 5 variables in the y axis. The code that I am using is the below: The name of my file is e.g. spec so spec-read.csv(spec.csv) head (spec) str(spec) names-names(spec)[2:6]

Re: [R] KS and AD test for Generalized PAreto and Generalized Extreme value

2012-01-04 Thread R. Michael Weylandt
fExtremes::pgpd pgev have always worked for me. Though, if I remember right, the physical sciences and finance tend to use reciprocal definitions for one of the parameters (can't remember which -- xi in gpd perhaps?) so tread lightly. Michael On Wed, Jan 4, 2012 at 8:21 AM, David Winsemius

Re: [R] Warning message about closing a connection XXXX

2012-01-04 Thread William Dunlap
Re How can I avoid the warning message altogether? ?closeAllConnections I think of calls to closeAllConnections() in the same way that I think of calls to rm(list=objects()): they both can remove things that are not theirs to remove. Calling gc() will close all unused connections, so no

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-04 Thread Rich Shepard
On Tue, 3 Jan 2012, David Winsemius wrote: burns.tds[ !duplicated(burns.tds) , ] Apparently it does not matter if the site column in the data frame is a factor or a character, read.zoo() generates the same error. Applying the above produces a long list starting with:

Re: [R] Warning message about closing a connection XXXX

2012-01-04 Thread Prof Brian Ripley
On 04/01/2012 17:12, William Dunlap wrote: Re How can I avoid the warning message altogether? ?closeAllConnections I think of calls to closeAllConnections() in the same way that I think of calls to rm(list=objects()): they both can remove things that are not theirs to remove. Calling

Re: [R] subscript with comma

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 10:51 AM, Uwe Ligges wrote: On 04.01.2012 16:12, suse wrote: Hi, I want to write a word with subscript in a graph. Unfortunately, the subscript contains a comma, so all my trials didn't work and I didn't find how to do it. I want to write sm as normal text and w,grass

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 12:21 PM, Rich Shepard wrote: On Tue, 3 Jan 2012, David Winsemius wrote: burns.tds[ !duplicated(burns.tds) , ] Apparently it does not matter if the site column in the data frame is a factor or a character, read.zoo() generates the same error. Applying the above

Re: [R] Warning message about closing a connection XXXX

2012-01-04 Thread Duncan Murdoch
On 12-01-04 12:25 PM, Prof Brian Ripley wrote: On 04/01/2012 17:12, William Dunlap wrote: Re How can I avoid the warning message altogether? ?closeAllConnections I think of calls to closeAllConnections() in the same way that I think of calls to rm(list=objects()): they both can

Re: [R] subscript with comma

2012-01-04 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of David Winsemius Sent: Wednesday, January 04, 2012 9:53 AM To: Uwe Ligges Cc: r-help@r-project.org; suse Subject: Re: [R] subscript with comma On Jan 4, 2012, at 10:51 AM,

Re: [R] Warning message about closing a connection XXXX

2012-01-04 Thread Prof Brian Ripley
On 04/01/2012 18:21, Duncan Murdoch wrote: On 12-01-04 12:25 PM, Prof Brian Ripley wrote: On 04/01/2012 17:12, William Dunlap wrote: Re How can I avoid the warning message altogether? ?closeAllConnections I think of calls to closeAllConnections() in the same way that I think of calls to

Re: [R] Is using glht with Tukey for lme post-hoc comparisons an appropriate substitute to TukeyHSD?

2012-01-04 Thread Richard M. Heiberger
Anne, Thank you for writing back, and for including your data. I have two things here. First, I ran an a analysis of your data and have my observations on interpretation. Second, I answer your general question about glht and TukeyHSD when there are interactions. I illustrate how to get the

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-04 Thread Rich Shepard
On Wed, 4 Jan 2012, David Winsemius wrote: You didn't ask for what was duplicated, but rather what was NOT duplicated with that code. In the case of a dataframe it is the entire row that is tested. My original question was what was duplicated, but ... I changed the function by dropping the

Re: [R] Adding a vertical line to plot with two overlapping density plots

2012-01-04 Thread David L Carlson
That works, but if all you want is one vertical line at 0, this will work densityplot(~value, thedata.m, groups=variable,auto.key=list(columns=2), panel = function(x, y, ...) { panel.densityplot(x, ...) panel.abline(v=0) } )

Re: [R] Warning message about closing a connection XXXX

2012-01-04 Thread peter dalgaard
On Jan 4, 2012, at 19:21 , Duncan Murdoch wrote: On 12-01-04 12:25 PM, Prof Brian Ripley wrote: Rather than using a sledgehammer, use showConnections(all=TRUE) to see all connections, and close the ones you want to (and its help page shows you how). In older versions that do give the

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-04 Thread David Winsemius
Nothing attached. I don't know what you entitled teh compressed dput output but it did not pass the filters of the mailserver and you did not copy me. If chemdata is available as a text file, hten make sure its extension is .txt and then attach it. -- David. On Jan 4, 2012, at 1:31 PM,

Re: [R] Using a mathematical expression in sapply() XXXX

2012-01-04 Thread peter dalgaard
On Jan 4, 2012, at 16:32 , David Winsemius wrote: On Jan 4, 2012, at 9:17 AM, peter dalgaard wrote: On Jan 4, 2012, at 14:57 , Milan Bouchet-Valat wrote: Le mercredi 04 janvier 2012 à 08:41 -0500, Dan Abner a écrit : Hello everyone, I have the following call to sapply() and error

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries' [FIXED]

2012-01-04 Thread Rich Shepard
On Wed, 4 Jan 2012, David Winsemius wrote: Nothing attached. I don't know what you entitled teh compressed dput output but it did not pass the filters of the mailserver and you did not copy me. David, It must have been stripped off as too large (14K). Regardless, I solved the problem:

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries' [FIXED]

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 3:21 PM, Rich Shepard wrote: On Wed, 4 Jan 2012, David Winsemius wrote: Nothing attached. I don't know what you entitled teh compressed dput output but it did not pass the filters of the mailserver and you did not copy me. David, It must have been stripped off as

[R] Passing multiple arguments to a function through sapply() XXXX

2012-01-04 Thread Dan Abner
Hello everyone, How does one pass multiple arguments of a user defined function to that function when called within sapply()? I have the following: myna-function(x,miss.val) {x[x %in% miss.val]-NA;x} mydataNA3-sapply(mydataNA,c(x=myna,miss.val=c(9,99))) Error in match.fun(FUN) : 'c(x =

Re: [R] Passing multiple arguments to a function through sapply() XXXX

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 3:47 PM, Dan Abner wrote: Hello everyone, How does one pass multiple arguments of a user defined function to that function when called within sapply()? I have the following: myna-function(x,miss.val) {x[x %in% miss.val]-NA;x}

Re: [R] putting regression output right on a plot

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 11:30 AM, Mark Leeds wrote: hi: does anyone know if it's possible and, if so, where there's an example, of putting the output of summary(lm) right on the plot of the data itself. If the answer is to use capture.output and then text, I'll try that but I was thinking

Re: [R] Warning message about closing a connection XXXX

2012-01-04 Thread Martin Morgan
On 01/04/2012 09:25 AM, Prof Brian Ripley wrote: On 04/01/2012 17:12, William Dunlap wrote: Re How can I avoid the warning message altogether? ?closeAllConnections I think of calls to closeAllConnections() in the same way that I think of calls to rm(list=objects()): they both can remove

[R] [newbie] stack operations, or functions with side effects (or both)

2012-01-04 Thread Tom Roche
summary: Specifically, how does one do stack/FIFO operations in R? Generally, how does one code functions with side effects in R? details: I have been a coder for years, mostly using C-like semantics (e.g., Java). I am now trying to become a scientist, and to use R, but I don't yet have the

Re: [R] [newbie] stack operations, or functions with side effects (or both)

2012-01-04 Thread Justin Haynes
do s[1] and s[-1] do what you're looking for? those are just to display... if you want to change s, you need to reassign it or fiddle with namespacing. however, I'd say it is better to write R code as though data structures are immutable until you explicitly re-assign them rather than trying to

Re: [R] tcltk on linux/rhel6

2012-01-04 Thread Carl Baribault
Brian, FYI, I had previously installed tcl-devel but had overlooked tk-devel on the OS. Now that I've installed tk-devel on the OS, the following sequence of commands has succeeded: sudo ./configure --with-tcltk sudo make sudo make check sudo make install R ... library(tcltk) Loading Tcl/Tk

Re: [R] calculate quantiles of a custom function

2012-01-04 Thread Gerhard
Am Dienstag, 3. Januar 2012, 19:51:36 schrieb Prof. Dr. Matthias Kohl: D - AbscontDistribution(d = function(x) dbeta(x, 2, 6) + dbeta(x,6,2), low = 0, up = 1, withStand = TRUE) Dear all, thank you all again for your help. So, summing up, (in case this might be useful to other beginners -

[R] problem on plotting ts data

2012-01-04 Thread lornyi
Hi, i try to plot ts data on x-y coordiante I want my data to be points, but somehow it always comes out with lines and # linked bwtween data, i used plot(lag(x,-9),y,type=p), x and y are time series data is there anyway to remove those lines? Thanks a lot -- View this message in context:

[R] Combining characters

2012-01-04 Thread jeremy
Hi all, I'm trying to combine exhaustively several character arrays in R like: x=c(one,two,three) y=c(yellow,blue,green) z=c(apple,cheese) in order to get concatenation of x[1] y[1] z[1] (one yellow apple) x[1] y[1] z[2] (one yellow cheese) x[1] y[2] z[1](one blue apple) ... x[length(x)]

[R] Symbols in graph

2012-01-04 Thread Y Nygård
Hi, Is there an easy way to add symbols to a line in a scatter plot, so that only a few symbols are added per line (a line drawn based on a large set of data points) , in order to distinguish several lines in one graph (not a symbol for each data point as is the default in plot()). Thanks a lot!

Re: [R] subscript with comma

2012-01-04 Thread suse
Thank you! It works now. But I still don't understand, how all these expressions, , paste, group, eval... have to be used together. (For example, I first tried expression(sm[w,grass]) but it didn't work, and I couldn't find, why (and when) commas are interpreted here differently). So: Is there

Re: [R] problem on plotting ts data

2012-01-04 Thread lornyi
thanks, it works! -- View this message in context: http://r.789695.n4.nabble.com/problem-on-plotting-ts-data-tp4261865p4262179.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] problem on plotting ts data

2012-01-04 Thread Rui Barradas
Hello, Try 'as.vector' or 'as.numeric' x - as.ts(rnorm(20)) y - as.ts(rnorm(20)) plot(x) plot(as.vector(lag(x,-9)),as.vector(y),type=p) # works plot(as.numeric(lag(x,-9)),as.numeric(y),type=p) # also works Rui Barradas -- View this message in context:

Re: [R] function in R for my exercise

2012-01-04 Thread Thomthom
Hi Michael, Thanks for your answer! sorry I didn't see this rule... No problem, I'll try to figure it out by myself. Thanks for your indication though! Thomas 2012/1/4, Michael Weylandt [via R] ml-node+s789695n4261894...@n4.nabble.com: Unfortunately, there's a general no-homework rule

[R] plot rq lm

2012-01-04 Thread agent dunham
Dear Community, I'd like to plot an rq object the same way I do with a lm one, is it possible? Something like this plot(rqmodel , 1:4, id.labels=rownames(pga1)); where rqmodel - rq(log(vd) ~ v1 + log(v2) +log(v3) + v4 + v5 ,data =dat) Thanks in advance and apologies, I'm pretty newbie with

Re: [R] Options for generating editable figures?

2012-01-04 Thread Allen McBride
Thank you for the advice; this is very helpful. I will see how they feel about installing Inkscape. I'll also work on getting R installed in a Windows environment so I can produce .emf and .wmf files. I found one old message on this list from someone who had luck doing this by running R with

Re: [R] Combining characters

2012-01-04 Thread Rui Barradas
Hello, If you want to apply the same procedure to all elements of an object, check out the '*apply' functions. In this case, x=c(one,two,three) y=c(yellow,blue,green) z=c(apple,cheese) lapply(x, function(x) paste(x, y)) gives a good picture of what you want to do, just transform it into a

[R] using var from bash in R script

2012-01-04 Thread dood
Dear R users, This probably a really noob question, but I'm stuck. I'd like to pass some variables from bash to R as strings. I can successfully pass variables using commandArgs(), the problem is that I end up with an array. So, for example: Args - commandArgs(TRUE) Args [1] one two three

Re: [R] RODBC installation: error message

2012-01-04 Thread gregory benison
One thing R could do better is to provide a standard way to view README and similar files before installing a package.  That might have helped here. Agreed... right now, the R documentation points to a straightforward, one-line way to download and install packages from the R command line, but

Re: [R] Combining characters

2012-01-04 Thread andrija djurovic
Hi. You can use expand.grid here expand.grid(x,y,z) Andrija On Wed, Jan 4, 2012 at 5:32 PM, jeremy jeremynamer...@gmail.com wrote: Hi all, I'm trying to combine exhaustively several character arrays in R like: x=c(one,two,three) y=c(yellow,blue,green) z=c(apple,cheese) in order to get

Re: [R] Combining characters

2012-01-04 Thread R. Michael Weylandt
? expand.grid Michael On Wed, Jan 4, 2012 at 10:32 AM, jeremy jeremynamer...@gmail.com wrote: Hi all, I'm trying to combine exhaustively several character arrays in R like: x=c(one,two,three) y=c(yellow,blue,green) z=c(apple,cheese) in order to get concatenation of x[1] y[1] z[1]  (one

Re: [R] Combining characters

2012-01-04 Thread Marc Schwartz
On Jan 4, 2012, at 10:32 AM, jeremy wrote: Hi all, I'm trying to combine exhaustively several character arrays in R like: x=c(one,two,three) y=c(yellow,blue,green) z=c(apple,cheese) in order to get concatenation of x[1] y[1] z[1] (one yellow apple) x[1] y[1] z[2] (one yellow

Re: [R] Combining characters

2012-01-04 Thread Joshua Wiley
Try expand.grid() to create all the combinations. Then just collapse them with paste(): apply(expand.grid(x, y, z), 1, paste, collapse = ) Cheers, Josh On Wed, Jan 4, 2012 at 8:32 AM, jeremy jeremynamer...@gmail.com wrote: Hi all, I'm trying to combine exhaustively several character

Re: [R] Combining characters

2012-01-04 Thread Justin Haynes
apply(expand.grid(x, y, z, stringsAsFactors=F), 1, paste, collapse=' ') On Wed, Jan 4, 2012 at 8:32 AM, jeremy jeremynamer...@gmail.com wrote: Hi all, I'm trying to combine exhaustively several character arrays in R like: x=c(one,two,three) y=c(yellow,blue,green) z=c(apple,cheese) in

Re: [R] using var from bash in R script

2012-01-04 Thread Marc Schwartz
On Jan 4, 2012, at 3:08 PM, dood wrote: Dear R users, This probably a really noob question, but I'm stuck. I'd like to pass some variables from bash to R as strings. I can successfully pass variables using commandArgs(), the problem is that I end up with an array. So, for example: Args

Re: [R] Symbols in graph

2012-01-04 Thread Jim Lemon
Hi, Is there an easy way to add symbols to a line in a scatter plot, so that only a few symbols are added per line (a line drawn based on a large set of data points) , in order to distinguish several lines in one graph (not a symbol for each data point as is the default in plot()). Hi

[R] a quick question about rbinom

2012-01-04 Thread lynn.tsai
Hello, I have the following code using rbinom, but I don't understand what *+1* means in the code. Could someone help? Thanks so much, X1-c(A,B)[rbinom(n,1,0.6)+1] X2-c(C,D)[rbinom(n,1,0.1)+1] -- View this message in context:

Re: [R] a quick question about rbinom

2012-01-04 Thread Bert Gunter
Homework? If not, context? -- Bert On Wed, Jan 4, 2012 at 1:38 PM, lynn.tsai vernal@gmail.com wrote: Hello, I have the following code using rbinom, but I don't understand what *+1* means in the code. Could someone help? Thanks so much, X1-c(A,B)[rbinom(n,1,0.6)+1]

Re: [R] a quick question about rbinom

2012-01-04 Thread Justin Haynes
homework or not, ?rbinom should be plenty. On Wed, Jan 4, 2012 at 1:38 PM, lynn.tsai vernal@gmail.com wrote: Hello, I have the following code using rbinom, but I don't understand what *+1* means in the code. Could someone help? Thanks so much, X1-c(A,B)[rbinom(n,1,0.6)+1]

Re: [R] subscript with comma

2012-01-04 Thread Duncan Murdoch
On 12-01-04 11:41 AM, suse wrote: Thank you! It works now. But I still don't understand, how all these expressions, , paste, group, eval... have to be used together. (For example, I first tried expression(sm[w,grass]) but it didn't work, and I couldn't find, why (and when) commas are

Re: [R] About source()

2012-01-04 Thread Li SUN
Thanks, guys! I am using Rscript at the moment and will definitely try littler. Li Sun 2012/1/4 Rainer M Krug r.m.k...@gmail.com: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/01/12 10:39, Uwe Ligges wrote: On 03.01.2012 21:22, Li SUN wrote: Thanks, Rolf, Justin and Uwe!

  1   2   >