An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111207/5361fc2e/attachment.pl>
configuring a package for own personal needs
6 messages · Sachinthaka Abeywardana, R. Michael Weylandt, jim holtman +2 more
The easiest thing is probably to download source files from CRAN and edit the R code, which can be found in the R2Cuba_vvv/R/ directory (vvv is the version code), re-build and then you should be good permanently. I just looked at the source on my machine: very easily done, if you feel comfortable with the compiling which sounds like you are. Michael On Tue, Dec 6, 2011 at 6:39 PM, Sachinthaka Abeywardana
<sachin.abeywardana at gmail.com> wrote:
Hi All, There is a function in package "R2Cuba" called Cuhre that I need to use. It keeps spitting out a new-line which I really dont want it to do. So I was wondering what is the best way of configuring the package. I tried copying and pasting the code into Cuhre2 and getting rid of the newline command BUT that didn't work since it seems to have some private functions which I do not have access to. So what is the best way of rewriting the package and compiling it (some of the code is written in C). Note that I want to do some other configurations besides the above mentioned (incase you were going to mention some sort of noprint option). Thanks, Sachin ? ? ? ?[[alternative HTML version deleted]]
______________________________________________ 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.
Where is it spitting out the new-line to? Can you just capture the output and then remove the last new-line; easier than rewriting the function. Here is one way of doing it:
f.x <- function()cat('this is\n\n output\n with\n an extra linefeed at the end\n\n')
f.x() # has the extra line-feed
this is output with an extra linefeed at the end
x <- capture.output(f.x()) # capture the output # print it cat(x, sep = '\n')
this is output with an extra linefeed at the end
# remove the extra linefeed at the end cat(head(x, -1), sep = '\n') # now it is gone
this is output with an extra linefeed at the end
On Tue, Dec 6, 2011 at 6:39 PM, Sachinthaka Abeywardana
<sachin.abeywardana at gmail.com> wrote:
Hi All, There is a function in package "R2Cuba" called Cuhre that I need to use. It keeps spitting out a new-line which I really dont want it to do. So I was wondering what is the best way of configuring the package. I tried copying and pasting the code into Cuhre2 and getting rid of the newline command BUT that didn't work since it seems to have some private functions which I do not have access to. So what is the best way of rewriting the package and compiling it (some of the code is written in C). Note that I want to do some other configurations besides the above mentioned (incase you were going to mention some sort of noprint option). Thanks, Sachin ? ? ? ?[[alternative HTML version deleted]]
______________________________________________ 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.
Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it.
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111207/46048fff/attachment.pl>
RTFM. (Writing R Extensions. It comes with R.) Since you are asking this question I will hazard a guess that you are on Windows, and will want to install RTools per that documentation.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Sachinthaka Abeywardana <sachin.abeywardana at gmail.com> wrote:
Hi Michael/ everyone, I guess a big part of the question was also how would you compile (remember that some of the code is written in C)? Any recommended tutorials on this? Sachin On Wed, Dec 7, 2011 at 11:16 AM, R. Michael Weylandt < michael.weylandt at gmail.com> wrote:
The easiest thing is probably to download source files from CRAN and edit the R code, which can be found in the R2Cuba_vvv/R/ directory (vvv is the version code), re-build and then you should be good permanently. I just looked at the source on my machine: very easily done, if you feel comfortable with the compiling which sounds like
you
are. Michael On Tue, Dec 6, 2011 at 6:39 PM, Sachinthaka Abeywardana <sachin.abeywardana at gmail.com> wrote:
Hi All, There is a function in package "R2Cuba" called Cuhre that I need to
use.
It
keeps spitting out a new-line which I really dont want it to do. So
I was
wondering what is the best way of configuring the package. I tried
copying
and pasting the code into Cuhre2 and getting rid of the newline
command
BUT
that didn't work since it seems to have some private functions
which I do
not have access to. So what is the best way of rewriting the package and compiling it
(some
of
the code is written in C). Note that I want to do some other
configurations
besides the above mentioned (incase you were going to mention some
sort
of
noprint option).
Thanks,
Sachin
[[alternative HTML version deleted]]
______________________________________________ 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.
[[alternative HTML version deleted]]
______________________________________________ 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.
On Dec 6, 2011, at 10:22 PM, Jeff Newmiller wrote:
RTFM. (Writing R Extensions. It comes with R.) Since you are asking this question I will hazard a guess that you are on Windows, and will want to install RTools per that documentation.
In addition to ReadingThatF'ingManl, you may also want to look at Rcpp (and its extensions). It's not as clear to me that you are on Windows (I'm not).
David. > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go > Live... > DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. > Live Go... > Live: OO#.. Dead: OO#.. > Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. > rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > Sachinthaka Abeywardana <sachin.abeywardana at gmail.com> wrote: > >> Hi Michael/ everyone, >> >> I guess a big part of the question was also how would you compile >> (remember >> that some of the code is written in C)? Any recommended tutorials on >> this? >> >> Sachin >> >> On Wed, Dec 7, 2011 at 11:16 AM, R. Michael Weylandt < >> michael.weylandt at gmail.com> wrote: >> >>> The easiest thing is probably to download source files from CRAN and >>> edit the R code, which can be found in the R2Cuba_vvv/R/ directory >>> (vvv is the version code), re-build and then you should be good >>> permanently. I just looked at the source on my machine: very easily >>> done, if you feel comfortable with the compiling which sounds like >> you >>> are. >>> >>> Michael >>> >>> On Tue, Dec 6, 2011 at 6:39 PM, Sachinthaka Abeywardana >>> <sachin.abeywardana at gmail.com> wrote: >>>> Hi All, >>>> >>>> There is a function in package "R2Cuba" called Cuhre that I need to >> use. >>> It >>>> keeps spitting out a new-line which I really dont want it to do. So >> I was >>>> wondering what is the best way of configuring the package. I tried >>> copying >>>> and pasting the code into Cuhre2 and getting rid of the newline >> command >>> BUT >>>> that didn't work since it seems to have some private functions >> which I do >>>> not have access to. >>>> >>>> So what is the best way of rewriting the package and compiling it >> (some >>> of >>>> the code is written in C). Note that I want to do some other >>> configurations >>>> besides the above mentioned (incase you were going to mention some >> sort >>> of >>>> noprint option). >>>> >>>> Thanks, >>>> Sachin >>>> >>>> [[alternative HTML version deleted]] >>>> >>>> ______________________________________________ >>>> 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. >>> >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> 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. > > ______________________________________________ > 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. David Winsemius, MD West Hartford, CT