Re: [R] Is there any good tools to facilitate us to create R functions?

2007-08-17 Thread Weiwei Shi
s, > We have some programs for the specific task in our research, but they were > very commonly used. We want to make some functions for them, anybody can > recommend any good tools to facilitate us to create R functions even without > going deep into the theories of R functions ? &

Re: [R] Is there any good tools to facilitate us to create R functions?

2007-08-17 Thread Francisco J. Zagmutt
; very commonly used. We want to make some functions for them, anybody can > recommend any good tools to facilitate us to create R functions even without > going deep into the theories of R functions ? > Any suggestions or help are greatly appreciated. > _

Re: [R] Is there any good tools to facilitate us to create R functions?

2007-08-17 Thread Uwe Ligges
zhijie zhang wrote: > Dear R users, > We have some programs for the specific task in our research, but they were > very commonly used. We want to make some functions for them, anybody can > recommend any good tools to facilitate us to create R functions even without > goin

[R] Is there any good tools to facilitate us to create R functions?

2007-08-17 Thread zhijie zhang
Dear R users, We have some programs for the specific task in our research, but they were very commonly used. We want to make some functions for them, anybody can recommend any good tools to facilitate us to create R functions even without going deep into the theories of R functions ? Any

Re: [R] Functions for autoregressive Regressionmodels (Mix between times series and Regression Models) ?

2007-08-07 Thread Achim Zeileis
On Tue, 7 Aug 2007, Gabor Grothendieck wrote: > arima (see ?arima) supports explanatory variables in the xreg= argument. In addition to arima(), the function dynlm() in package "dynlm" might be useful if you want to fit the model by OLS. See also package "dyn" for a similar approach. Z > On 8/7/

Re: [R] Functions for autoregressive Regressionmodels (Mix between times series and Regression Models) ?

2007-08-07 Thread Gabor Grothendieck
arima (see ?arima) supports explanatory variables in the xreg= argument. On 8/7/07, "Maja Schröter" <[EMAIL PROTECTED]> wrote: > Hello everybody, > > I've a question about "autoregressive Regressionmodels". > > Let Y[1],.,Y[n], be a time series. > > Given the model: > > Y[t] = phi[1]*Y[t-1] +

[R] Functions for autoregressive Regressionmodels (Mix between times series and Regression Models) ?

2007-08-07 Thread Maja Schröter
Hello everybody, I've a question about "autoregressive Regressionmodels". Let Y[1],.,Y[n], be a time series. Given the model: Y[t] = phi[1]*Y[t-1] + phi[2]*Y[t-1] + ... + phi[p]*Y[t-p] + x_t^T*beta + u_t, where x_t=(x[1t],x[2t],x[mt]) and beta=(beta[1],...,beta[m]) and u_t~(0,1) I w

[R] Calling R functions from a Microsoft SQL Server stored procedure

2007-07-30 Thread Luis Gerardo Gonzalez Morales
Does anyone have any advice on how to call R functions from a Microsoft SQL Server stored procedure? So far, I have no problem querying and saving to the database from R using RODBC. However, I wonder whether it is possible to work in the opposite direction: calling R from SQL Server, sending

Re: [R] Need Help: User Defined R Functions in Sweave/Latex

2007-06-21 Thread M. Jankowski
> Back to Dieter's solution for a moment, take note of the Sweave FAQ > (also in the above manual), specifically FAQ A.9, which covers the issue > of figure chunks and multiple plots, proposing a looping approach > consistent with Dieter's. > > I hope that this might give you some other insights in

Re: [R] Need Help: User Defined R Functions in Sweave/Latex

2007-06-21 Thread Marc Schwartz
gt; > My Sweave code is intended to make lots of plots and create a *.pdf > document. Sweave is perfect for this. The only problem is that I find > myself using the same R code, within my Sweave input file over an > over. I know about Latex macros and I can even get R functions, > esse

[R] User Defined R Functions in Sweave/Latex

2007-06-21 Thread Dieter Menne
M. Jankowski gmail.com> writes: > My Sweave code is intended to make lots of plots and create a *.pdf > document. Sweave is perfect for this. The only problem is that I find > myself using the same R code, within my Sweave input file over an > over. > This is the R function: > basicplot

[R] Need Help: User Defined R Functions in Sweave/Latex

2007-06-20 Thread M. Jankowski
for this. The only problem is that I find myself using the same R code, within my Sweave input file over an over. I know about Latex macros and I can even get R functions, essentially used as subroutines, to sort of work. "\Sexpr{}" will not work because the R code I want to use over and

Re: [R] Excel calling R functions

2007-06-01 Thread Horace Tso
that does not require writing R commands but uses the language independent spirit of DCOM. And it also allows event handlers for things like Excel actions to be written as R functions Tobias Verbeke wrote: > Marc Schwartz wrote: >> On Fri, 2007-06-01 at 08:50 -0700, Horace Tso wrote: >&g

Re: [R] Excel calling R functions

2007-06-01 Thread Duncan Temple Lang
things like Excel actions to be written as R functions Tobias Verbeke wrote: > Marc Schwartz wrote: >> On Fri, 2007-06-01 at 08:50 -0700, Horace Tso wrote: >>> Hi folks, >>> >>> Is it possible to have Excel call a R function. If not, how about >>> makin

Re: [R] Excel calling R functions

2007-06-01 Thread Tobias Verbeke
Marc Schwartz wrote: > On Fri, 2007-06-01 at 08:50 -0700, Horace Tso wrote: >> Hi folks, >> >> Is it possible to have Excel call a R function. If not, how about >> making Excel send off a command to call a R script and then read the >> result back into Excel. >> >> I know, I know, this should belon

Re: [R] Excel calling R functions

2007-06-01 Thread Alberto Monteiro
Horace Tso wrote: > > Is it possible to have Excel call a R function. If not, how about > making Excel send off a command to call a R script and then read the > result back into Excel. > > I know, I know, this should belong to some Excel forum, but i just > try my luck here. > You can always

Re: [R] Excel calling R functions

2007-06-01 Thread Horace Tso
14-455-3265 http://www.StatisticalEngineering.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Horace Tso Sent: Friday, June 01, 2007 11:51 AM To: r-help@stat.math.ethz.ch Subject: [R] Excel calling R functions Hi folks, Is it possible to have Excel

Re: [R] Excel calling R functions

2007-06-01 Thread Charles Annis, P.E.
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Horace Tso Sent: Friday, June 01, 2007 11:51 AM To: r-help@stat.math.ethz.ch Subject: [R] Excel calling R functions Hi folks, Is it possible to have Excel call a R function. If not, how about making Excel send off a command to call a R script

Re: [R] Excel calling R functions

2007-06-01 Thread Marc Schwartz
On Fri, 2007-06-01 at 08:50 -0700, Horace Tso wrote: > Hi folks, > > Is it possible to have Excel call a R function. If not, how about > making Excel send off a command to call a R script and then read the > result back into Excel. > > I know, I know, this should belong to some Excel forum, but i

[R] Excel calling R functions

2007-06-01 Thread Horace Tso
Hi folks, Is it possible to have Excel call a R function. If not, how about making Excel send off a command to call a R script and then read the result back into Excel. I know, I know, this should belong to some Excel forum, but i just try my luck here. Thanks in advance. Horace W. Tso _

Re: [R] functions without arguments

2007-05-30 Thread Petr Klasterecky
Sure it is possible, but it is a very bad and possibly dangerous idea, since you may not control what's passed to your function. Consider this example: > x <- 1:5 > x [1] 1 2 3 4 5 > foo <- function(){mean(x)} > foo() [1] 3 > rm('x') > foo() Error in mean(x) : object "x" not found It is m

[R] functions without arguments

2007-05-30 Thread elyakhlifi mustapha
hello, I wanna know if it's possible to write functions without argument in order to understand that I write down an example f <- function(){ for (i in 1:length(C[[1]]) { print(10*C[[1]][i]) } } I know that there are errors in this syntax

[R] Calling R functions in Delphi

2006-12-07 Thread Anna Belova
Dear All, Thank you very much for all the insights! We truly appreciate your thought and your time. --Anna - Anna Belova Abt Associates Inc. 4800 Montgomery Ln, St 600 Bethesda, MD-20814 phone: 301-347-5304 http://www.abtassociates.com/environment --

Re: [R] Calling R functions in Delphi

2006-12-06 Thread Tom Backer Johnsen
Earl F. Glynn wrote: > Thanks for the great example, Tom. > > "Tom Backer Johnsen" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Anna Belova wrote: > >>> We would like to call quantile() function from the R-package STATS in a >>> Delphi program. If this is possible, could anyo

Re: [R] Calling R functions in Delphi

2006-12-06 Thread Earl F. Glynn
Thanks for the great example, Tom. "Tom Backer Johnsen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Anna Belova wrote: >> We would like to call quantile() function from the R-package STATS in a >> Delphi program. If this is possible, could anyone provide us with an >> example?

Re: [R] Calling R functions in Delphi

2006-12-06 Thread Erich Neuwirth
R(D)COM available from CRAN (section Other) gives you R as a COM server. If Delphi can act as a COM client (which I think is true), you can access R directly from within your program without the need to write files. > Anna Belova wrote: >> Hello All, >> >> We would like to call quantile() functi

Re: [R] Calling R functions in Delphi

2006-12-05 Thread Tom Backer Johnsen
<[EMAIL PROTECTED]> > 12/05/2006 12:36 cc > PMr-help@stat.math.ethz.ch >

Re: [R] Calling R functions in Delphi

2006-12-05 Thread Tom Backer Johnsen
Anna Belova wrote: > Hello All, > > We would like to call quantile() function from the R-package STATS in a > Delphi program. If this is possible, could anyone provide us with an > example? It is possible, and in principle simple. The essentials: (1) Write a file containing the something like

Re: [R] Calling R functions in Delphi

2006-12-05 Thread Hans-Peter
2006/12/5, Rainer M Krug <[EMAIL PROTECTED]>: > There was a translation of the header files from C to Delphi, so that > you could used R directly without using DCom - Hans-Peter Suter > translated / made them. Thanks for mentioning. You can download these files any time from: - http://treetron.g

Re: [R] Calling R functions in Delphi

2006-12-04 Thread Rainer M Krug
Anna Belova wrote: > Hello All, > > We would like to call quantile() function from the R-package STATS in a > Delphi program. If this is possible, could anyone provide us with an > example? Hi Anna There was a translation of the header files from C to Delphi, so that you could used R directly w

Re: [R] Calling R functions in Delphi

2006-12-04 Thread Francisco Zagmutt
If your only interest is the quantile function, you may consider implementing your own version in Pascal. Since R is open source you can look at the source code here: https://svn.r-project.org/R/trunk/src/library/stats/R/quantile.R And use the code as a guideline (I recommend reading the GNU l

Re: [R] Calling R functions in Delphi

2006-12-04 Thread Duncan Murdoch
On 12/4/2006 2:27 PM, Anna Belova wrote: > Hello All, > > We would like to call quantile() function from the R-package STATS in a > Delphi program. If this is possible, could anyone provide us with an > example? You probably want to be talking to the Rcom-l list, see

[R] Calling R functions in Delphi

2006-12-04 Thread Anna Belova
Hello All, We would like to call quantile() function from the R-package STATS in a Delphi program. If this is possible, could anyone provide us with an example? Thanks in advance. --Anna - Anna Belova Abt Associates Inc. 4800 Montgomery Ln, St 600 Bethesd

Re: [R] functions and strings

2006-09-13 Thread Peter Dalgaard
Robin Hankin <[EMAIL PROTECTED]> writes: > Rich > > that is swet > > and does exactly what I want. > > Thank you very much. I just wonder whatever substitute() did to get ignored like that? > substitute(1 + sin(cos(x)) + exp(x^2), list(x=quote(xyz))) 1 + sin(cos(xyz)) + exp(xyz^2

Re: [R] functions and strings

2006-09-13 Thread Robin Hankin
Rich that is swet and does exactly what I want. Thank you very much. best wishes rksh On 13 Sep 2006, at 10:54, Rich FitzJohn wrote: > Hi, > > Perhaps try this (based on 'bquote'): > > rewrite.expression <- function(expr, to, dep) { > f <- function(expr) { > if ( length(ex

Re: [R] functions and strings

2006-09-13 Thread Rich FitzJohn
Hi, Perhaps try this (based on 'bquote'): rewrite.expression <- function(expr, to, dep) { f <- function(expr) { if ( length(expr) == 1 ) if ( expr == as.name(dep) ) as.name(to) else expr else as.call(lapply(expr, f)) } f(expr) } rewrite <- function

Re: [R] functions and strings

2006-09-13 Thread Robin Hankin
Hello everyone I know it looks like I'm making heavy weather of this, but I don't think I communicated my problem properly. I really appreciate you guys' help here. I am writing a wrapper for a mathematical library to which I want to send character strings that it can execute, and then pass the

Re: [R] functions and strings

2006-09-13 Thread Robin Hankin
Hi Dmitris, Thierry, I'm getting there but it's still not quite right if f() includes something like x^2: f <- function(x){exp(x^2)} >> gsub("(x)", "(xyz)", deparse(body(f))[2], fixed = TRUE) [1] "x^2" [I don't care about the spaces] also, I can't quite see how to implement Thierr

Re: [R] functions and strings

2006-09-13 Thread Dimitris Rizopoulos
-- Original Message - From: "Robin Hankin" <[EMAIL PROTECTED]> To: "Dimitris Rizopoulos" <[EMAIL PROTECTED]> Cc: "Robin Hankin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, September 13, 2006 9:54 AM Subject: Re: [R] functions an

Re: [R] functions and strings

2006-09-13 Thread Robin Hankin
Hi Dmitris thanks for this but it's not quite right: > f <- function(x){sin(x)+exp(x)} > strng <- gsub("x", "xyz", deparse(body(f))[2]) > sub('^[[:space:]]+', '', strng) [1] "sin(xyz) + exyzp(xyz)" and I would want "sin(xyz) + exp(xyz)" On 13 Sep 2006, at 08:45, Dimitris Rizopoulos wro

Re: [R] functions and strings

2006-09-13 Thread Dimitris Rizopoulos
[EMAIL PROTECTED]> Sent: Wednesday, September 13, 2006 9:10 AM Subject: [R] functions and strings > Hi > > If > > string <- "xyz" > f <- function(x){1 + sin(cos(x)) + exp(x^2)} > > How do I manipulate "string" and f() to give the string >

Re: [R] functions and strings

2006-09-13 Thread Romain Francois
Robin Hankin wrote: > Hi > > If > > string <- "xyz" > f <- function(x){1 + sin(cos(x)) + exp(x^2)} > > How do I manipulate "string" and f() to give the string > > "1 + sin(cos(xyz)) + exp(xyz^2)" > > ? > Hi, Here what i'll do : f <- function(x){ sprintf("1 + sin(cos(%s)) + exp(%s^2)", x, x)

[R] functions and strings

2006-09-13 Thread Robin Hankin
Hi If string <- "xyz" f <- function(x){1 + sin(cos(x)) + exp(x^2)} How do I manipulate "string" and f() to give the string "1 + sin(cos(xyz)) + exp(xyz^2)" ? -- Robin Hankin Uncertainty Analyst National Oceanography Centre, Southampton European Way, Southampton SO14 3ZH, UK tel 023-8059-7

Re: [R] Functions ,Optim, & Dataframe

2006-07-31 Thread Tony Plate
I added an example of passing additional arguments through optim() to the objective and gradient functions to the Discussion section of the Wiki-fied R documentation. See it at http://wiki.r-project.org/rwiki/doku.php?id=rdoc:stats:optim -- Tony Plate PS. I had to add "&purge=true" to the en

Re: [R] Functions ,Optim, & Dataframe

2006-07-31 Thread Tony Plate
Supply your additional arguments to optim() and they will get passed to your function: > mydat<-data.frame(d1=c(3,5),d2=c(6,10),p1=c(.55,.05),p2=c(.85,.35)) > > fr<-function(x, d) { + # d is a vector of d1, d2, p1 & p2 + u <- x[1] + v <- x[2] + d1 <- d[1] + d2 <- d[2] +

[R] Functions ,Optim, & Dataframe

2006-07-31 Thread Michael Papenfus
I think I need to clarify a little further on my original question. I have the following two rows of data: mydat<-data.frame(d1=c(3,5),d2=c(6,10),p1=c(.55,.05),p2=c(.85,.35)) >mydat d1 d2 p1 p2 1 3 6 0.55 0.85 2 5 10 0.05 0.35 I need to optimize the following function using optim for each row

Re: [R] Functions ,Optim, & Dataframe

2006-07-30 Thread Dieter Menne
Michael Papenfus wisc.edu> writes: > > I have defined the following function: > > fr<-function(x) { > u<-x[1] > v<-x[2] > sqrt(sum((plnorm(c(3,6),u,v)-c(.55,.85))^2)) > } > which I then solve using optim > y<-optim(c(1,1),fr) > > > y$par > [1] 1.0029771 0.7610545 > This works fine

[R] Functions ,Optim, & Dataframe

2006-07-30 Thread Michael Papenfus
I have defined the following function: fr<-function(x) { u<-x[1] v<-x[2] sqrt(sum((plnorm(c(3,6),u,v)-c(.55,.85))^2)) } which I then solve using optim y<-optim(c(1,1),fr) > y$par [1] 1.0029771 0.7610545 This works fine. Now I want to use these two steps on a dataframe: mydat<-data.

Re: [R] Functions starting with underscores

2006-06-04 Thread Philippe Grosjean
It is not allowed to start a variable name with an underscore. So, you must use "`" to call this non-conventional name: > '_foo' <- function(x) 1 > attr('_foo', 'bar') <- 'pow' Error: target of assignment expands to non-language object > attr(`_foo`, 'bar') <- 'pow' > '_foo' [1] "_foo" > `_f

Re: [R] Functions starting with underscores

2006-06-04 Thread Gabor Grothendieck
Use backticks: attr(`_foo`, "bar") <- "pow" On 6/5/06, Joseph Wang <[EMAIL PROTECTED]> wrote: > I'm having problems with functions starting with underscores > > '_foo' <- function(x) {1} > > seems to work > > but I can't assign an attribute to this function > > attr('_foo', 'bar') <- 'pow' > > An

[R] Functions starting with underscores

2006-06-04 Thread Joseph Wang
I'm having problems with functions starting with underscores '_foo' <- function(x) {1} seems to work but I can't assign an attribute to this function attr('_foo', 'bar') <- 'pow' Any way of doing this? This is for a C++ -> R wrapping system so I'd like to keep the C++ names which start with

Re: [R] can I use R functions in BRUGS to define a complex likelihood?

2006-03-13 Thread Uwe Ligges
Johannes Reichl wrote: > Hello > > I need to define complex likelihoods in BRUGS-> mixed multinomial > probit & random coefficient tobit for panel data > can I use the likelihood that i`ve written in R in the BRUGS model? > This is a (Win/Open)BUGS question which is not related to R (except t

[R] can I use R functions in BRUGS to define a complex likelihood?

2006-03-13 Thread Johannes Reichl
Hello I need to define complex likelihoods in BRUGS-> mixed multinomial probit & random coefficient tobit for panel data can I use the likelihood that i`ve written in R in the BRUGS model? if not, how can I deal with complex likelihoods in BRUGS, there is no integrate function in BRUGS? is th

[R] Call user written R functions in C

2006-03-09 Thread Xuehong.Sun
I have written some R functions and want to call them in C. Is there any way to do it? I have read through the "Writing R Extensions"document. It seems that the only R functions that we can call in C is wrapped in Rmath.h or by embedding R.dll. Thanks. [[alternative HT

Re: [R] How can one use R-code and R-functions within C-Code?

2006-02-22 Thread Romain Francois
either me nor my collegue succeded in obtaining C-code for > something, which has certainly already be programmed in C several times. > > But we know, that R functions like "multinom" exist, which could do the job. > This is why we would like to use R-Code and R-functi

Re: [R] How can one use R-code and R-functions within C-Code?

2006-02-22 Thread Prof Brian Ripley
ue succeded in obtaining C-code for something, > which has certainly already be programmed in C several times. > > But we know, that R functions like "multinom" exist, which could do the > job. This is why we would like to use R-Code and R-functions within or > C+

[R] How can one use R-code and R-functions within C-Code?

2006-02-22 Thread moritz . marienfeld
already be programmed in C several times. But we know, that R functions like "multinom" exist, which could do the job. This is why we would like to use R-Code and R-functions within or C++ program if this is possible. So I have actually two questions: Is it feasible to use R-code

Re: [R] How to access values returned by R functions (to put into vectors)?

2006-02-13 Thread ronggui
06.02.14>whatyouwant<-coef(A) 06.02.14>whatyouwant Emp C50 0.99891134.7957189 9934.6481222 2006/2/14, Quin Wills <[EMAIL PROTECTED]>: > The question is general for all functions, but here is a specific example - > > > > # For the logistic regression of the fol

Re: [R] How to access values returned by R functions (to put into vectors)?

2006-02-13 Thread Gabor Grothendieck
Try this: coef(A) On 2/13/06, Quin Wills <[EMAIL PROTECTED]> wrote: > The question is general for all functions, but here is a specific example - > > > > # For the logistic regression of the following correlated variables: > > C <- c(457, 1371, 4113, 12339, 37017, 111051, 333153, 999459) >

[R] How to access values returned by R functions (to put into vectors)?

2006-02-13 Thread Quin Wills
The question is general for all functions, but here is a specific example - # For the logistic regression of the following correlated variables: C <- c(457, 1371, 4113, 12339, 37017, 111051, 333153, 999459) E <- c(0.003858377, 0.014334578, 0.014092836, 0.737950754, 0.996371828, 0.997482

Re: [R] Glossay of available R functions

2006-02-05 Thread Patricia J. Hawkins
> "MHHS" == Martin Henry H Stevens <[EMAIL PROTECTED]> writes: MHHS> Start R help, and select the Search Engine & Keywords link. This MHHS> will take you to a page where keywords (including functions) are MHHS> arranged by topic. It includes base and "recommended" MHHS> packages. Also not tha

Re: [R] Glossay of available R functions

2006-02-05 Thread Patricia J. Hawkins
> "PBR" == Prof Brian Ripley <[EMAIL PROTECTED]> writes: >> commenting that subset was new to him, though he did say "list of >> functions in R". I'd searched through everything _else_ in the help >> system looking for such a glossary; I hadn't thought to look under >> *Packages*, as those ar

Re: [R] Glossay of available R functions

2006-02-04 Thread Jim Porzak
Alexandre & Patricia, As Bert Gunter periodically points out: "Newbies (and others!) may find useful the R Reference Card made available by Tom Short and Rpad at http://www.rpad.org/Rpad/Rpad-refcard.pdf or through the "Contributed" link on CRAN (where some other reference cards are also linked).

Re: [R] Glossay of available R functions

2006-02-04 Thread Martin Henry H. Stevens
Hi Patricia and Alexandre, Start R help, and select the Search Engine & Keywords link. This will take you to a page where keywords (including functions) are arranged by topic. It includes base and "recommended" packages. Also not that on the CRAN website (and mirrors) is a link for Task Views

Re: [R] Glossay of available R functions

2006-02-02 Thread Prof Brian Ripley
On Thu, 2 Feb 2006, Patricia J. Hawkins wrote: >> "JB" == Jonathan Baron <[EMAIL PROTECTED]> writes: > > JB> In addition, the search page at > JB> http://finzi.psych.upenn.edu > > JB> can search all functions of all CRAN packages. > > JB> This is also available through > > JB> RSiteSearch(stri

Re: [R] Glossay of available R functions

2006-02-02 Thread Patricia J. Hawkins
> "JB" == Jonathan Baron <[EMAIL PROTECTED]> writes: JB> In addition, the search page at JB> http://finzi.psych.upenn.edu JB> can search all functions of all CRAN packages. JB> This is also available through JB> RSiteSearch(string,restrict="functions"). Thank you all! In fact, what I was

Re: [R] Help with R: functions

2006-01-31 Thread Pryseley Assam
Dear R-users Thanks for all the help/suggestions, they have been most helpful. Best regards Pryseley - [[alternative HTML version deleted]] __ R-help@stat.math.et

Re: [R] Glossay of available R functions

2006-01-31 Thread Jonathan Baron
In addition, the search page at http://finzi.psych.upenn.edu can search all functions of all CRAN packages. This is also available through RSiteSearch(string,restrict="functions"). See the help page for RSiteSearch. Jon -- Jonathan Baron, Professor of Psychology, University of Pennsylvania H

Re: [R] Glossay of available R functions

2006-01-31 Thread Christos Hatzis
Patricia J. Hawkins Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Glossay of available R functions On Mon, 30 Jan 2006, Patricia J. Hawkins wrote: >>>>>> "ASA" == Alexandre Santos Aguiar <[EMAIL PROTECTED]> writes: > > ASA> I am new to R and read this li

Re: [R] Glossay of available R functions

2006-01-31 Thread Prof Brian Ripley
On Mon, 30 Jan 2006, Patricia J. Hawkins wrote: >> "ASA" == Alexandre Santos Aguiar <[EMAIL PROTECTED]> writes: > > ASA> I am new to R and read this list to learn. It is amazing how > ASA> frequently new functions pop in messages. Useful and timesaving > ASA> functions like subset (above) must

Re: [R] Glossay of available R functions

2006-01-30 Thread Patricia J. Hawkins
> "ASA" == Alexandre Santos Aguiar <[EMAIL PROTECTED]> writes: ASA> I am new to R and read this list to learn. It is amazing how ASA> frequently new functions pop in messages. Useful and timesaving ASA> functions like subset (above) must be documented somewhere. ASA> Is there a glossary of fu

Re: [R] Glossay of available R functions

2006-01-30 Thread Chuck Cleland
I am not sure what you mean by a glossary, but subset and rownames are both in the R Reference Index: http://cran.r-project.org/doc/manuals/fullrefman.pdf If you suspect there might be an R function for something but don't know what it is, help.search() can be useful. For example: help.search

[R] Glossay of available R functions

2006-01-30 Thread Alexandre Santos Aguiar
Em Seg 30 Jan 2006 18:36, Chuck Cleland escreveu: > rownames(subset(mydata, X >=0)) Hi, I am new to R and read this list to learn. It is amazing how frequently new functions pop in messages. Useful and timesaving functions like subset (above) must be documented somewhere. Is there a glossary

Re: [R] Help with R: functions

2006-01-30 Thread Liaw, Andy
This might be a bit closer to what Pryseley wanted: st <- function(dat, x, y) { f <- formula(substitute(y ~ x), env=environment(dat)) plot(f, dat) abline(lm(f, dat)) } Note that the variable names in the plot when tested on `dats' as Pryseley created. Andy From: Jacques VESLOT > >

Re: [R] Help with R: functions

2006-01-30 Thread Jacques VESLOT
st <- function(data, x, y){ attach(data) rcc <- coef(lm(y~x)) plot(x,y) abline(rcc) detach(data)} st(data=dats, x=visual24, y=visual52) Pryseley Assam a écrit : >Hello R-users > > I am new to R and trying to write some functions. I have problems writing > functions tha

Re: [R] Help with R: functions

2006-01-30 Thread Philippe Grosjean
# Here it is (using the formula interface): dats <- data.frame(visual24 = rnorm(30, 3, 5), visual52 = rt(30, 7)) st <- function(formula, data, ...) { # Just use the formula to specify which variables to use rcc <- coef(lm(formula, data)) # Make sure to k

Re: [R] Help with R: functions

2006-01-30 Thread TEMPL Matthias
hz.ch > Betreff: [R] Help with R: functions > > > > Hello R-users > > I am new to R and trying to write some functions. I have > problems writing functions that takes a data set as an > arguement and uses variables in the data. I illustrate my >

[R] Help with R: functions

2006-01-30 Thread Pryseley Assam
Hello R-users I am new to R and trying to write some functions. I have problems writing functions that takes a data set as an arguement and uses variables in the data. I illustrate my problem with a small example below: sample data #-- visual24<-rnorm(30,3,5) v

Re: [R] R-functions in C-Code

2005-10-31 Thread Roger Bivand
On Mon, 31 Oct 2005, Olaf Schenk wrote: > Dear R users, > > I would like to use several R functions from a C-code and I have read > the "Introduction to the .C Interface to R". Unfortunately, my shared > library with the C-code works only in cases where I use R-ro

[R] R-functions in C-Code

2005-10-31 Thread Olaf Schenk
Dear R users, I would like to use several R functions from a C-code and I have read the "Introduction to the .C Interface to R". Unfortunately, my shared library with the C-code works only in cases where I use R-routines that are defined Rmath.h, eg.

[R] Calling R functions from C

2005-10-28 Thread Florent Baty
Dear R users, I read on the "Introduction to the .C Interface to R" by Peng & Leeuw (http://www.biostat.jhsph.edu/~rpeng/docs/interface.pdf) that it is possible to use a few R functions (such as "dnorm") within C by including the "Rmath.h" header file in you

Re: [R] Finding code for R functions

2005-10-19 Thread Roger D. Peng
er Wolfrum, Ed wrote: > Greetings, > > I am trying to figure out how to find the source code for R functions. I > am specifically interested in finding the code for the "prcomp" > function. I know that typing the function name without parenthesis will > lead to the code

Re: [R] Finding code for R functions

2005-10-18 Thread Duncan Murdoch
Wolfrum, Ed wrote: > Greetings, > > I am trying to figure out how to find the source code for R functions. I > am specifically interested in finding the code for the "prcomp" > function. I know that typing the function name without parenthesis will > lead to th

Re: [R] Finding code for R functions

2005-10-18 Thread Berton Gunter
P. Box > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Wolfrum, Ed > Sent: Tuesday, October 18, 2005 2:27 PM > To: r-help@stat.math.ethz.ch > Subject: [R] Finding code for R functions > > Greetings, > > I am trying to

[R] Finding code for R functions

2005-10-18 Thread Wolfrum, Ed
Greetings, I am trying to figure out how to find the source code for R functions. I am specifically interested in finding the code for the "prcomp" function. I know that typing the function name without parenthesis will lead to the code (or to a .Internal or .FORTRAN or .C call).

Re: [R] Can R functions be implented in Matlab

2005-10-12 Thread Duncan Temple Lang
contrib/R-and-octave-2.txt > > On 10/12/05, Madhu Kishore <[EMAIL PROTECTED]> wrote: > >>Hi, >>I am Madhu Kishore a Graduate student at University of Texas at El Paso >> in Electrical Engineering. I am using R language for Normality tests and my >> doubt

Re: [R] Can R functions be implented in Matlab

2005-10-12 Thread Gabor Grothendieck
Normality tests and my > doubt is can implements the R functions in Matlab. I expect to hear from you > soon. > Madhu kishore. > > > - > >[[alternative HTML version deleted]] > > __ &g

Re: [R] Can R functions be implented in Matlab

2005-10-12 Thread Ted Harding
On 12-Oct-05 Madhu Kishore wrote: > Hi, > I am Madhu Kishore a Graduate student at University of Texas at El > Paso in Electrical Engineering. I am using R language for Normality > tests and my doubt is can implements the R functions in Matlab. I > expect to hear from yo

Re: [R] functions available for use with aggregate?

2005-10-12 Thread Spencer Graves
1. There is also "aggregate.zoo" in the "zoo" package. 2. If your question is which functions can be used for the "FUN" argument, you can write your own. For example: > set.seed(1) > tstDF <- data.frame(x=rep(1:4, e=2), + y=rnorm(8)) > aggregate(tstD

[R] Can R functions be implented in Matlab

2005-10-12 Thread Madhu Kishore
Hi, I am Madhu Kishore a Graduate student at University of Texas at El Paso in Electrical Engineering. I am using R language for Normality tests and my doubt is can implements the R functions in Matlab. I expect to hear from you soon. Madhu kishore

Re: [R] functions available for use with aggregate?

2005-10-12 Thread Sundar Dorai-Raj
t c wrote: > What are the functions available for use with “aggregate”? Where can a > reference to them be found? > > Since aggregate is a S3 generic, you can use methods(aggregate) to see what objects have an "aggregate" method. For me, I have the following: > methods(aggregate) [1] a

[R] functions available for use with aggregate?

2005-10-12 Thread t c
What are the functions available for use with “aggregate”? Where can a reference to them be found? - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https:/

Re: [R] source of R functions {was ... aov ...}

2005-06-23 Thread Duncan Murdoch
On 6/23/2005 12:57 PM, Martin Maechler wrote: >> "RenE" == RenE J V Bertin <[EMAIL PROTECTED]> >> on Thu, 23 Jun 2005 17:37:14 +0200 writes: > > RenE> Thanks to all the others who replied. > > BDR> and do note it is unset again a few lines later. > BDR> (Listing a fun

[R] source of R functions {was ... aov ...}

2005-06-23 Thread Martin Maechler
> "RenE" == RenE J V Bertin <[EMAIL PROTECTED]> > on Thu, 23 Jun 2005 17:37:14 +0200 writes: RenE> Thanks to all the others who replied. BDR> and do note it is unset again a few lines later. BDR> (Listing a function inside R is not giving you the BDR> `source co

RE: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Thomas Lumley
On Tue, 7 Jun 2005, Liaw, Andy wrote: The easiest way, perhaps, is to assign the internal functions to frame 1: Another easy way is to use the MC() function in section 3.3.1 of the R FAQ, which makes function closures in a way that works in S-PLUS. -thomas

Re: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Spencer Graves
p.s. This modification gave the same answer for me in both S-Plus 6.2 and R 2.1.0 patched under Windows XP. Spencer Graves wrote: How about the following: mainfunc <- function(x){ est <- function(x,par){ abs(sum(par*x)) } func <- function(par,x, est.=est){ est.(x,par) } est.theta <- fu

Re: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Spencer Graves
How about the following: mainfunc <- function(x){ est <- function(x,par){ abs(sum(par*x)) } func <- function(par,x, est.=est){ est.(x,par) } est.theta <- function(x, func.=func, est.=est){ optimize(func.,lower=-10, upper=20,x=x, est.=est.)$minimum } est.theta(x, func.

Re: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Sundar Dorai-Raj
Victor Gravenholt wrote: Sorry to bother you about a S-Plus related problem, but I hope someone can help. I have tried to "translate" some code from R to S-Plus (I have colleague that insists on using S-Plus. And yes, I have tried to make him change to R...) The following code works out fine

RE: [R] Functions within functions in R and S-Plus

2005-06-07 Thread Liaw, Andy
The easiest way, perhaps, is to assign the internal functions to frame 1: > mainfunc <- function(x){ + + est <- function(x,par){ + abs(sum(par*x)) + } + + func <- function(par,x){ + est(x,par) + } + + est.theta <- function(x){ + optimize(func,lower=-10, upper=20,x=x)$minimum + } +

[R] Functions within functions in R and S-Plus

2005-06-07 Thread Victor Gravenholt
Sorry to bother you about a S-Plus related problem, but I hope someone can help. I have tried to "translate" some code from R to S-Plus (I have colleague that insists on using S-Plus. And yes, I have tried to make him change to R...) The following code works out fine in R, but in S-Plus (S-PLUS

  1   2   >