Hi, I am very new to R so please excuse me if I am asking very obvious questions. I am trying to call a blackbox api function implemented in as a COM object from R. The function definition says that 1. if calling from VBA, the first parameter should be set to "Nothing" 2. if calling from matlab, the first parameter should be set to [] What should be the equivalent for above in R?. Thanks lm -- View this message in context: http://r.789695.n4.nabble.com/Equivalent-of-Nothing-in-VBA-or-in-Matlab-in-R-tp4595385p4595385.html Sent from the R help mailing list archive at Nabble.com.
R. Michael Weylandt <michael.weylandt@gmail.com>
2012-Apr-29 14:36 UTC
[R] Equivalent of Nothing (in VBA) or [] in Matlab in R
Perhaps NULL? Or maybe a vector of length 0....you can also just leave arguments missing in R thanks to lazy evaluation so there's not a single equivalent to "nothing" Hth, Michael On Apr 28, 2012, at 6:04 PM, lm <shinilkumar at hotmail.com> wrote:> Hi, I am very new to R so please excuse me if I am asking very obvious > questions. > > I am trying to call a blackbox api function implemented in as a COM object > from R. The function definition says that > > 1. if calling from VBA, the first parameter should be set to "Nothing" > 2. if calling from matlab, the first parameter should be set to [] > > What should be the equivalent for above in R?. > > Thanks > lm > > -- > View this message in context: http://r.789695.n4.nabble.com/Equivalent-of-Nothing-in-VBA-or-in-Matlab-in-R-tp4595385p4595385.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
ruipbarradas at sapo.pt
2012-May-02 01:33 UTC
[R] Equivalent of Nothing (in VBA) or [] in Matlab in R
Hello, I'm glad it worked. You could have posted it in r-help, this may be of use to others... Rui Barradas Citando sb kr <shinilkumar@hotmail.com>:> Hi Rui Barradas, as you guessed the second option worked > > Thanks again > > lm > >> Date: Sun, 29 Apr 2012 16:52:45 -0700 > > From: ruipbarradas@sapo.pt > > To: r-help@r-project.org > > Subject: Re: [R] Equivalent of Nothing (in VBA) or [] in Matlab in R > > > > Hello, > > > > There are other types of "empty" objects in R (zero length or > dimension). > > Maybe some of these > > > > x <- list() > > length(x) > > > > x <- matrix(list()) > > dim(x) <- c(0, 0) > > x > > > > Matlab's [] is the empty matrix so maybe the second works. > > Other possibilities could be x <- numeric(0) (or integer(0) or > > character(0)). > > Trial and error might get you there... > > > > Hope this helps, > > > > Rui Barradas > > > > > > -- > > View this message in context: > http://r.789695.n4.nabble.com/Equivalent-of-Nothing-in-VBA-or-in-Matlab-in-R-tp4595385p4597157.html > > Sent from the R help mailing list archive at Nabble.com. > > > > ______________________________________________ > > R-help@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > >[[alternative HTML version deleted]]