Re: [R] How to permanently remove [Previously saved workspace restored]

2010-11-13 Thread Peter Langfelder
On Sat, Nov 13, 2010 at 10:33 PM, Stephen Liu wrote: > Win 7 64 bit > R version 2.11.1 (2010-05-31) > > > How to permanently remove; > [Previously saved workspace restored] > >> rm (list = ls( )) > > On next start it still displays; > . > [Previously saved workspace restored] > > > There is a

Re: [R] How to permanently remove [Previously saved workspace restored]

2010-11-13 Thread Joshua Wiley
On Sat, Nov 13, 2010 at 10:33 PM, Stephen Liu wrote: > > Win 7 64 bit > R version 2.11.1 (2010-05-31) > > > How to permanently remove; > [Previously saved workspace restored] > > > rm (list = ls( )) > > On next start it still displays; > . > [Previously saved workspace restored] > > > There is

[R] How to permanently remove [Previously saved workspace restored]

2010-11-13 Thread Stephen Liu
Win 7 64 bit R version 2.11.1 (2010-05-31) How to permanently remove; [Previously saved workspace restored] > rm (list = ls( )) On next start it still displays; . [Previously saved workspace restored] There is a file keeping the previous data on Linux .Rdata How about on Windows? TIA B

Re: [R] Replicate Excel's LOGEST worksheet function in R

2010-11-13 Thread Jeff Newmiller
Most software for curve fitting uses linear fits in conjunction with some combination of logarithms of your original in order to obtain logarithmic, power or exponential curve fits. The nls approach is arguably more correct, but it will yield different results than "normal", and may be finicky w

Re: [R] writing to a file

2010-11-13 Thread jim holtman
The HELP page for 'sink' is pretty clear about this: sink() or sink(file=NULL) ends the last diversion (of the specified type). There is a stack of diversions for normal output, so output reverts to the previous diversion (if there was one). The stack is of up to 21 connections (20 diversions).

[R] writing to a file

2010-11-13 Thread Gregory Ryslik
Hi, I have a fairly complex object that I have written a print function for. Thus when I do print(results), the R console shows me a whole bunch of stuff already formatted. What I want to do is to take whatever print(results) shows to console and then put that in a file. I am doing this using t

Re: [R] Replicate Excel's LOGEST worksheet function in R

2010-11-13 Thread cran . 30 . miller_2555
On Nov 13, 2010, at 10:12 PM, cran.30.miller_2...@spamgourmet.com wrote: > On Fri, Nov 12, 2010 at 5:28 PM, David Winsemius - > cran.30.miller_2...@spamgourmet.com > <+cran > +miller_2555+c0e7477398.dwinsemius#comcast@spamgourmet.com> wrote: > > On Nov 12, 2010, at 5:07 PM, David Winsemiu

Re: [R] Sweave question

2010-11-13 Thread Ralf B
Thank you. The article you cited explains on the last page how this is done and shows how Sweave is run from within R and it says that it creates the .tex file. My last remaining question is now if there is a way to execute this Sweave tex output by executing Latex from R. In other words, what is

Re: [R] Replicate Excel's LOGEST worksheet function in R

2010-11-13 Thread cran . 30 . miller_2555
On Fri, Nov 12, 2010 at 5:28 PM, David Winsemius - dwinsem...@comcast.net <+cran+miller_2555+c0e7477398.dwinsemius#comcast@spamgourmet.com> wrote: > > On Nov 12, 2010, at 5:07 PM, David Winsemius wrote: > > >> On Nov 12, 2010, at 4:22 PM, cran.30.miller_2...@spamgourmet.com wrote: >> >> Hi -

Re: [R] barplot3d cutting off labels

2010-11-13 Thread David Winsemius
On Nov 13, 2010, at 5:11 PM, emorway wrote: Hello, Using the function that is available at: http://addictedtor.free.fr/graphiques/sources/source_161.R The following command leads to a plot with labels that are cut off: barplot3d(c(4.01,4.71,2.03,1.28,1.42,1.76,0, 6.58,3.25,3.11,

[R] barplot3d cutting off labels

2010-11-13 Thread emorway
Hello, Using the function that is available at: http://addictedtor.free.fr/graphiques/sources/source_161.R The following command leads to a plot with labels that are cut off: barplot3d(c(4.01,4.71,2.03,1.28,1.42,1.76,0, 6.58,3.25,3.11,2.10,2.05,1.19,1.28, 6.44,5.50,3.6

Re: [R] Sweave question

2010-11-13 Thread Johannes Huesing
Ralf B [Sat, Nov 13, 2010 at 10:03:49PM CET]: > It seems that Sweave is supposed to be used from Latex and R is called > during the LaTeX compilation process whenever R chunks appear. This is not how it works. In the first page of http://www.statistik.lmu.de/~leisch/Sweave/Sweave-Rnews-2002-3.

[R] Sweave question

2010-11-13 Thread Ralf B
It seems that Sweave is supposed to be used from Latex and R is called during the LaTeX compilation process whenever R chunks appear. What about the other way round? I would like to run it triggered by R. Is this possible? I understand that this does not correspond to the idea of literate programmi

Re: [R] Re : interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors

2010-11-13 Thread David Winsemius
On Nov 13, 2010, at 3:24 PM, Biau David wrote: Thank you David for your answer, - grade2 is a factor with 2 categories: "high" and "low" So "high" would be 1 and low would be 2 by default (alpha ordering) factor behavior. as.logical(grade2=="high") reverses that order. If you wanted a mo

[R] Re : interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors

2010-11-13 Thread Biau David
Thank you David for your answer, - grade2 is a factor with 2 categories: "high" and "low" - yes as.factor is superfluous; it is just that it avoids warnings sometimes. This can be overlooked. - I will look into Terry Therneau answers; he gives a good explanation on how to obtain the hazard for

Re: [R] How to turn the colour off for lattice graph?

2010-11-13 Thread David Winsemius
On Nov 13, 2010, at 3:16 PM, Shige Song wrote: With the following code: --- ltheme <- canonical.theme(color = FALSE) ## in-built B&W theme ltheme$strip.background$col <- "transparent" ## change strip bg lattice.options(default.theme = ltheme) ## set as default -

Re: [R] truncate integers

2010-11-13 Thread Tyler Dean Rudolph
Thank you David; this seems to perform the required task with relative ease, which is all I could ask for at the moment! Tyler On Sat, Nov 13, 2010 at 1:32 PM, David Winsemius wrote: > > On Nov 13, 2010, at 12:34 PM, T.D. Rudolph wrote: > > >> Is there any really easy way to truncate integers w

[R] Clark method enhancement to ChainLadder package

2010-11-13 Thread Daniel Murphy
Greetings, Version 0.1.4-0 of the ChainLadder package is available via CRAN and http://code.google.com/p/chainladder/ The ChainLadder package, which is focused on claims reserving methods typically carried out by property/casualty insurance actuaries, has recently been enhanced to implement the m

Re: [R] How to turn the colour off for lattice graph?

2010-11-13 Thread Shige Song
With the following code: --- ltheme <- canonical.theme(color = FALSE) ## in-built B&W theme ltheme$strip.background$col <- "transparent" ## change strip bg lattice.options(default.theme = ltheme) ## set as default --- I was able to get a nice-looking b&w figure from

[R] aggregate with missing values, data.frame vs formula

2010-11-13 Thread David Freedman
It seems that the formula and data.frame forms of aggregate handle missing values differently. For example, (d=data.frame(sex=rep(0:1,each=3), wt=c(100,110,120,200,210,NA),ht=c(10,20,NA,30,40,50))) x1=aggregate(d, by = list(d$sex), FUN = mean); names(x1)[3:4]=c('list.wt','list.ht') x2=aggregate

[R] LAPACK lib problem, lme4, lastest R, Linux

2010-11-13 Thread Ron Burns
I just dumped Vista off a laptop and installed Ubuntu 10.10 (latest release) as the single operating system. I did all of the updates and then installed emacs and ess. Next I installed R by following the the usual instructions on the CRAN site. At this point all is working I am now in the proce

Re: [R] interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors

2010-11-13 Thread David Winsemius
On Nov 13, 2010, at 12:51 PM, Biau David wrote: Dear R help list, I am modeling some survival data with coxph and survreg (dist='weibull') using package survival. I have 2 problems: 1) I do not understand how to interpret the regression coefficients in the survreg output and it is not cl

Re: [R] Summing functions of lists

2010-11-13 Thread Phil Spector
Does this version of y do what you want? y=function(j)sum(sapply(1:3,function(i)x(i,j))) - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] truncate integers

2010-11-13 Thread David Winsemius
On Nov 13, 2010, at 12:34 PM, T.D. Rudolph wrote: Is there any really easy way to truncate integers with several consecutive digits without rounding and without converting from numeric to character (using strsplit, etc.)?? Something along these lines: e.g. = 456 truncfun(e.g., location

[R] Summing functions of lists

2010-11-13 Thread Hiba Baroud
Hi I'm trying to sum functions of lists with different lengths. Here is a simplified example of the problem: r=list(1:3,1:5,1:2) r [[1]] [1] 1 2 3 [[2]] [1] 1 2 3 4 5 [[3]] [1] 1 2 x=function(i,j) sum(j*r[[i]])# x is a function of two parameters: i & j y

Re: [R] RMySQL on Windows 2008 64 Bit -Help!

2010-11-13 Thread Uwe Ligges
Well, two comments: 1. you bought a commercial version of R from Revolution Analytics, hence you probably want to rely on the Revolution service? 2. Nobody looked at the error message you got, let me cite the relevant two lines: >>> checking for $MYSQL_HOME... C:/Program Files/MySQL/MySQL

[R] interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors

2010-11-13 Thread Biau David
Dear R help list, I am modeling some survival data with coxph and survreg (dist='weibull') using package survival. I have 2 problems: 1) I do not understand how to interpret the regression coefficients in the survreg output and it is not clear, for me, from ?survreg.objects how to. Here is an

Re: [R] Problem retrieving data from R2InBUGS

2010-11-13 Thread Uwe Ligges
This is strange and does not happen for me. Anyway, if it is a problem at all, then I doubt it is in R2WinBUGS: R2WinBUGS asks WinBUGS to write the coda files and afterwards calls the following function read.bugs <- function(codafiles, ...){ if(!is.R() && !require("coda")) stop("p

[R] truncate integers

2010-11-13 Thread T.D. Rudolph
Is there any really easy way to truncate integers with several consecutive digits without rounding and without converting from numeric to character (using strsplit, etc.)?? Something along these lines: e.g. = 456 truncfun(e.g., location=1) = 4 truncfun(e.g., location=1:2) = 45 truncfun(e.g.,

Re: [R] R2WinBUGS: Error in bugs(program="openbugs") but not openbugs()

2010-11-13 Thread Uwe Ligges
On 13.11.2010 18:05, Uwe Ligges wrote: I found the problem which is a scoping issue in BRugs::bugsData() and will fix it for the next release. For now, you can workaround by calling your parameters (in this case particularly beta) with a names that are different from R function names (e.g. cal

Re: [R] R2WinBUGS: Error in bugs(program="openbugs") but not openbugs()

2010-11-13 Thread Uwe Ligges
I found the problem which is a scoping issue in BRugs::bugsData() and will fix it for the next release. For now, you can workaround by calling your parameters (in this case particularly beta) with a names that are different from R function names (e.g. call it beta1). Best wishes, Uwe O

Re: [R] Question about the "effects" package

2010-11-13 Thread Shige Song
Dear John, This is exactly what I need, thank you so much for the tip (and thank you so much for this wonderful package too). Best, Shige On Sat, Nov 13, 2010 at 10:50 AM, John Fox wrote: > Dear Shige, > > As documented in ?plot.eff, the default is to plot on the scale of the > linear predictor

Re: [R] (no subject)

2010-11-13 Thread Uwe Ligges
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html Uwe Ligges On 13.11.2010 17:18, sundar wrote: Gud evening sir ,I want do the cluster analysis algorithm in r software can u guide me sir My mail id is :sundars...@gmail.com And I want the brief explanation to fo

[R] clusters in evd package

2010-11-13 Thread dpender
Hi, I am using the clusters function in the evd package and was wondering if anyone knew how to set the row names as date/time objects. My data has 1 column of date and time and another of wave height (H). My two options are: 1 - When in import the data using read.table make sure that the row.n

[R] (no subject)

2010-11-13 Thread sundar
Gud evening sir ,I want do the cluster analysis algorithm in r software can u guide me sir My mail id is :sundars...@gmail.com And I want the brief explanation to for,do.while,if etc loops and conditions. Thank you sir. -- __ R-help@r-project.o

Re: [R] Efficient marginal sums?

2010-11-13 Thread David Winsemius
On Nov 13, 2010, at 10:49 AM, (Ted Harding) wrote: Hi Folks, [This is not unrelated to the current "vector of vectors" thread, but arises quite independently] Say I have a function f(x,y) which computes a value for scalar x and y; or, if either x=X or y=Y is a vector, a corresponding vector of

Re: [R] How to turn the colour off for lattice graph?

2010-11-13 Thread David Winsemius
On Nov 13, 2010, at 10:07 AM, Shige Song wrote: Dear All, I am trying to plot a lattice figure and include it in a LaTeX document via the TikZDevice package. I think the journal I am submitting to does not like colour figure, so I need to get rid of all the colours in the figure. If I directly

Re: [R] exploratory analysis of large categorical datasets

2010-11-13 Thread Kjetil Halvorsen
you can also look at correspondence analysis, which is implemented in multiple CRAN packages, for instance MASS, ade4 and others. See the multivariate analysis task view on CRAN. Kjetil On Thu, Nov 11, 2010 at 10:39 PM, Dennis Murphy wrote: > Hi: > > A good place to start would be package vcd an

Re: [R] Do loop

2010-11-13 Thread sundar
Gud evening sir ,I want do the cluster analysis algorithm in r software can u guide me sir My mail id is :sundars...@gmail.com And I want the brief explanation to for,do.while,if etc loops and conditions. Thank you sir. [[alternative HTML version deleted]] ___

[R] Looking for R bloggers in non-English languages

2010-11-13 Thread Tal Galili
Hello everyone, Today I started a non-English version of R-bloggers, at: http://www.r-bloggers.com/lang/ R-bloggers.com is a blog aggregator (or a meta-blog) that offers content about R from 133 bloggers, publishing about 1 to 5 new posts a day. I am happy to see over 2700 people had already sub

Re: [R] Vector

2010-11-13 Thread Uwe Ligges
Looks like we need to fix the spam checker, or maybe it is sufficient to train him with some other 1s examples ... ;-) Thanks for all your work that helps to keep the list clean of spam, Mark! Best wishes, Uwe On 12.11.2010 16:28, Mark Leeds wrote: that was my bad. I let it in because I

Re: [R] wind rose (oz.windrose) scale

2010-11-13 Thread Uwe Ligges
Looking at the code shows that the author forgot to scale the plot appropriately at all, since xlim/ylim is hardcoded: plot(0, xlim = c(-20, 20), ylim = c(-20, 20), type = "n", axes = FALSE, xlab = "", ylab = "", ...) Hence you may want to fix it and provide the patch to the package

Re: [R] Define a glm object with user-defined coefficients (logistic regression, family="binomial")

2010-11-13 Thread David Winsemius
On Nov 13, 2010, at 7:43 AM, Jürgen Biedermann wrote: Hi there, I just don't find the solution on the following problem. :( Suppose I have a dataframe with two predictor variables (x1,x2) and one depend binary variable (y). How is it possible to define a glm object (family="binomial") wit

Re: [R] Question about the "effects" package

2010-11-13 Thread John Fox
Dear Shige, As documented in ?plot.eff, the default is to plot on the scale of the linear predictor (the logit scale, for a logit model), which preserves the linearity of the model (which, I would think, is generally desirable), but to label the axis on the scale of the response (the probability s

[R] Efficient marginal sums?

2010-11-13 Thread Ted Harding
Hi Folks, [This is not unrelated to the current "vector of vectors" thread, but arises quite independently] Say I have a function f(x,y) which computes a value for scalar x and y; or, if either x=X or y=Y is a vector, a corresponding vector of values f(X,y) or f(x,Y) (with the usual built-in vect

Re: [R] Consistency of Logistic Regression

2010-11-13 Thread Uwe Ligges
On 12.11.2010 20:11, Marc Schwartz wrote: You are not creating your data set properly. Your 'mat' is: mat column1 column2 11 0 21 0 30 1 40 0 51 1 61 0 71 0 80 1 90

Re: [R] what does SEXP in R internals stand for

2010-11-13 Thread John Fang
Thank you! Best wishes, John 2010/11/13 Alexx Hardt > Am 13.11.2010 14:50, schrieb John Fang: > > Hi all, >> >> Is there any one that would give an explanation on the abbreviation SEXP >> used in R internals to represent a pointer to a data structure? >> >> Thanks! >> >> > S-Expression, I beli

Re: [R] Factor analysis

2010-11-13 Thread Liviu Andronic
On Sat, Nov 13, 2010 at 2:07 PM, Brima wrote: > > Thanks very much. However, I got an error message when I tried. > What I did is that I created a correlation matrix named dat which is the > only data I have and tried using the below > >> fa<- factanal(covmat = dat, factors=2, rotation="none", sco

[R] Question about the "effects" package

2010-11-13 Thread Shige Song
Dear All, I am using the "effects" package to produce predicted probability from a logistic regression. The graph looks really good. I soon realized that the y-axis is not spaced equally. For example, in my case, the distance between 0.02 and 0.04 is much greater than that between 0.06 and 0.08. I

Re: [R] Updating R packages

2010-11-13 Thread Uwe Ligges
On 13.11.2010 06:15, Jim Silverton wrote: I have been trying to update some R packages but I get the following error. Can you advise how mow to get around this . I am using the R for 64 bit windows. --- Please select a CRAN mirror for use in this session --- Warning in install.packages(update[

[R] How to turn the colour off for lattice graph?

2010-11-13 Thread Shige Song
Dear All, I am trying to plot a lattice figure and include it in a LaTeX document via the TikZDevice package. I think the journal I am submitting to does not like colour figure, so I need to get rid of all the colours in the figure. If I directly generate PDF or EPS, the option "trellis.device(col

Re: [R] how to store a vector of vectors

2010-11-13 Thread Alexx Hardt
Am 13.11.2010 15:48, schrieb Sarah Goslee: You are assuming that R is using row-major order for recycling elements, when in fact it is using column- major order. It doesn't show up in the first case, because all the elements of x are identical Oops. Mental note made. norm<- function(x, y

Re: [R] how to store a vector of vectors

2010-11-13 Thread Sarah Goslee
You are assuming that R is using row-major order for recycling elements, when in fact it is using column- major order. It doesn't show up in the first case, because all the elements of x are identical > x <- c(1,1,1) > matrix(x, nrow=2, ncol=3) [,1] [,2] [,3] [1,]111 [2,]1

Re: [R] issue with ... in write.fwf in gdata

2010-11-13 Thread Jan Wijffels
Hi Greg, That's indeed the solution. Thanks for updating the package. I'm looking forward to see it on CRAN. kind regards, Jan From: g...@warnes.net Date: Fri, 12 Nov 2010 14:39:46 -0500 Subject: Re: [R] issue with ... in write.fwf in gdata To: janwijff...@hotmail.com CC: r-help@r-project.org

[R] using if statment and loops to create data layout of recurrent events

2010-11-13 Thread avsha38
Hi , I have a data set with recurrence time (up to four) of myocardial infarction (MI). Part of the file is showing below: Num1Trt Sex TimeT1 T2 T3 T4 10111 1 9 12110 1 59

[R] Define a glm object with user-defined coefficients (logistic regression, family="binomial")

2010-11-13 Thread Jürgen Biedermann
Hi there, I just don't find the solution on the following problem. :( Suppose I have a dataframe with two predictor variables (x1,x2) and one depend binary variable (y). How is it possible to define a glm object (family="binomial") with a user defined logistic function like p(y) = exp(a + c1*

Re: [R] Factor analysis

2010-11-13 Thread Brima
Thanks very much. However, I got an error message when I tried. What I did is that I created a correlation matrix named dat which is the only data I have and tried using the below > fa<- factanal(covmat = dat, factors=2, rotation="none", scores="none") Error in factanal(covmat = dat, factors = 2,

Re: [R] what does SEXP in R internals stand for

2010-11-13 Thread Alexx Hardt
Am 13.11.2010 14:50, schrieb John Fang: Hi all, Is there any one that would give an explanation on the abbreviation SEXP used in R internals to represent a pointer to a data structure? Thanks! S-Expression, I believe: http://en.wikipedia.org/wiki/S-expression Best wishes, Alex _

Re: [R] how to store a vector of vectors

2010-11-13 Thread Alexx Hardt
Am 13.11.2010 14:39, schrieb Sarah Goslee: I at least would need to see an actual example of your code to be able to answer your question. My function: norm <- function(x,y){ sqrt( rowSums( (x-y)^2 ) ) } y <- matrix( c( 1,1,1, 2,3,4), nrow=2, byrow=TRUE) x <- c(1,1,1) H

Re: [R] RMySQL on Windows 2008 64 Bit -Help!

2010-11-13 Thread Spencer Graves
Hello: I suggest try R-SIG-DB email list. They focus specifically on databases, and you might get a better response there. Sorry I can't help more. Spencer On 11/13/2010 1:12 AM, Santosh Srinivas wrote: I could do that but will have to change all my code. It would be g

[R] what does SEXP in R internals stand for

2010-11-13 Thread John Fang
Hi all, Is there any one that would give an explanation on the abbreviation SEXP used in R internals to represent a pointer to a data structure? Thanks! Best wishes, John [[alternative HTML version deleted]] __ R-help@r-project.org mailing li

Re: [R] R on an iPad

2010-11-13 Thread Tal Galili
Hi Erin, I wrote about this half a year ago, I imagine most of the information there still holds true: http://www.r-statistics.com/2010/06/could-we-run-a-statistical-analysis-on-iphoneipad-using-r/ Contact Details:--- Contact me:

Re: [R] How to set an argument such that a function treats it as missing?

2010-11-13 Thread Marius Hofert
Ahh, thank you very much, precisely what I was looking for :-))) Cheers, Marius On 2010-11-13, at 12:41 , Duncan Murdoch wrote: > Marius Hofert wrote: >> Dear expeRts, >> I would like to call a function f from a function g with or without an >> argument. I use missing() to check if the argumen

Re: [R] how to store a vector of vectors

2010-11-13 Thread Duncan Murdoch
Alexx Hardt wrote: Hi, I'm trying to write a function to determine the euclidean distance between x (one point) and y (a set of n points). How should I pass y to the function? Until now, I used a matrix like that: | [,1] [,2] [,3] [1,] 0 2 1 [2,] 1 1 1 |

Re: [R] how to store a vector of vectors

2010-11-13 Thread Sarah Goslee
I at least would need to see an actual example of your code to be able to answer your question. But why not just use dist() and take the appropriate column of the resultant matrix? mydist <- function(x, amat) { # x is the single variable as a vector # amat is the remaining variables as rows alldi

Re: [R] Data Cube in R from CSV

2010-11-13 Thread clangkamp
Indeed I am looking for a View() type thing. Unfortunately I am no developer so I can just work with what is already there. The way forward is then to try everything with a very small cube which is still overseeable and then just do the same with the big one. But View() is really not good for larg

[R] how to store a vector of vectors

2010-11-13 Thread Alexx Hardt
Hi, I'm trying to write a function to determine the euclidean distance between x (one point) and y (a set of n points). How should I pass y to the function? Until now, I used a matrix like that: | [,1] [,2] [,3] [1,] 0 2 1 [2,] 1 1 1 | Which would pass the p

[R] Reading location info from kml files

2010-11-13 Thread fbielejec
Dear, I have a bunch of kml files in the general form: discrete rates with bayes factor larger than 3.0 rate1_part1 #rate1_style relativeToGround 1 -17.,14.75,0.0 -17.3257204,14.737026,1024.9356539689436

Re: [R] predict.coxph

2010-11-13 Thread Mike Marchywka
> Date: Fri, 12 Nov 2010 16:08:57 -0600 > From: thern...@mayo.edu > To: james.whan...@gmail.com > CC: r-help@r-project.org; haenl...@escpeurope.eu > Subject: Re: [R] predict.coxph > > Jim, > I respectfully disagree, and there is 5 decades of literatur

Re: [R] How to set an argument such that a function treats it as missing?

2010-11-13 Thread Duncan Murdoch
Marius Hofert wrote: Dear expeRts, I would like to call a function f from a function g with or without an argument. I use missing() to check if the argument is given. If it is not given, can I set it to anything such that the following function call (to f) behaves as if the argument isn't giv

Re: [R] How to set an argument such that a function treats it as missing?

2010-11-13 Thread Gabor Grothendieck
On Sat, Nov 13, 2010 at 3:14 AM, Marius Hofert wrote: > Dear expeRts, > > I would like to call a function f from a function g with or without an > argument. > I use missing() to check if the argument is given. If it is not given, can I > set > it to anything such that the following function call

Re: [R] How to set an argument such that a function treats it as missing?

2010-11-13 Thread Michael Bedward
Or yet another way which is (I think) a bit closer to your requirement... f <- function(x) { if (missing(x)) cat("x is missing \n") else cat("x was provided \n") } g <- function(x) { if (missing(x)) fcall <- call("f") else fcall <- call("f", x) eval(fcall) } On 13 November 20

Re: [R] How to set an argument such that a function treats it as missing?

2010-11-13 Thread Michael Bedward
Hello Marius, NULL is not the same as missing. You could something like this in various ways. Here are a couple... g <- function(x) { if (missing(x)) { f() } else { f(x) } } or change f to detect null args g <- function(x) { if (missing(x)) { x <- NULL } f(x) } f <- fu

Re: [R] RMySQL on Windows 2008 64 Bit -Help!

2010-11-13 Thread Santosh Srinivas
I could do that but will have to change all my code. It would be great if I could get RMySQL on the 64 bit machine. -Original Message- From: Ajay Ohri [mailto:ohri2...@gmail.com] Sent: 13 November 2010 14:13 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] RMySQL on Windows

Re: [R] RMySQL on Windows 2008 64 Bit -Help!

2010-11-13 Thread Ajay Ohri
did you try the RODBC package as well. Regards Ajay Websites- http://decisionstats.com http://dudeofdata.com Linkedin- www.linkedin.com/in/ajayohri On Sat, Nov 13, 2010 at 9:22 AM, Santosh Srinivas wrote: > Dear Group, > > I'm having lots of problems getting RMySQL on a 64 bit machine. I

[R] How to set an argument such that a function treats it as missing?

2010-11-13 Thread Marius Hofert
Dear expeRts, I would like to call a function f from a function g with or without an argument. I use missing() to check if the argument is given. If it is not given, can I set it to anything such that the following function call (to f) behaves as if the argument isn't given? It's probably bes