Dear R-devel members,
I would like to compile a package with two seperate shared libraries.
For example, in a package 'foo', a file 'bar.so' built from a distinct
set of source files should be installed in addition to the default
'foo.so' (or .dll on windows). Does anyone know about a way to
R CMD INSTALL is R code, and you can read it for yourself rather than
asking other people to do so for you. If you look in
tools:::.install.packages you will see
shlib_install - function(instdir, arch)
{
files - Sys.glob(paste0(*, SHLIB_EXT))
if
Very helpful, thank you.
A couple other questions, please:
1. I've got a function written in C, named my_c_function. In my R code I
call this function, passing to it an INTSXP and a STRSXP, respectively:
result - .Call(my_c_function, int_vector, str_vector)
The prototype of my_c_function
2. Any good references/resources for developing R? Nearly all the
documents I've found are for programming R as a user, not as a developer. I
have copies of the documentation, which are very helpful, but it'd be
helpful to have additional resources to fill in their gaps.
The best advice
On 15 November 2010 at 10:46, Hadley Wickham wrote:
| 2. Any good references/resources for developing R? Nearly all the
| documents I've found are for programming R as a user, not as a developer. I
| have copies of the documentation, which are very helpful, but it'd be
| helpful to have
On 11/15/2010 07:45 AM, Patrick Leyshock wrote:
Very helpful, thank you.
A couple other questions, please:
1. I've got a function written in C, named my_c_function. In my R
code I call this function, passing to it an INTSXP and a STRSXP,
respectively:
result - .Call(my_c_function,
Thanks Martin and Hadley, this is very helpful.
I should also add that I'm constantly reading the source code, but sometimes
a response like this one can eliminate many, many hours of puzzlement. Much
appreciated.
Patrick
On Mon, Nov 15, 2010 at 10:01 AM, Martin Morgan mtmor...@fhcrc.org
Hello,
Since people have whisperred about Rcpp, I'd like to play too.
On 11/15/2010 07:45 AM, Patrick Leyshock wrote:
Very helpful, thank you.
A couple other questions, please:
1. I've got a function written in C, named my_c_function. In my R
code I call this function, passing to it an
Thanks Martin and Hadley, this is very helpful.
I should also add that I'm constantly reading the source code, but sometimes
a response like this one can eliminate many, many hours of puzzlement. Much
appreciated.
Patrick
On Mon, Nov 15, 2010 at 12:07 PM, Patrick Leyshock
Hi there,
is there a way to create a NAMESPACE file based on Rd-files (or whatever is
needed in order to apply the regular expression ^[[:alpha:]]+ without(!)
resorting to package.skeleton() (as this kind of interferes with
roxygenize() pretty often)?
Thanks a lot,
Janko
If you're using roxygenise, explicitly tag functions that you want to
export with @export.
Hadley
On Mon, Nov 15, 2010 at 5:11 PM, Janko Thyson
janko.thy...@ku-eichstaett.de wrote:
Hi there,
is there a way to create a NAMESPACE file based on Rd-files (or whatever is
needed in order to apply
Dear List,
So far, I really like those new R5 classes. But what kind of puzzles me is
that it's not just enough to define the actual reference class, I also have
to assign it to an object (e.g. 'MyRefObj') in order to fire
'MyRefObj$new(.)'.
S4:
setClass(Blabla, .)
x - new(Blabla)
Sorry, I was stupid:
MyRefObj - setRefClass(Blabla, .)
One can always get the generator object of an defined class with
'getRefClass()'. So:
g - getRefClass(Blabla)
x - g$new(.)
Regards,
Janko
Von: Janko Thyson [mailto:janko.thy...@ku-eichstaett.de]
Gesendet: Dienstag,
Hi all,
I'm trying to understand how the search path and namespaces interact.
For example, take the devtools package which suggests the testthat
package. Here's what the search path looks like after I load each of
those packages:
library(devtools)
search()
[1] .GlobalEnv
On Mon, Nov 15, 2010 at 3:26 PM, Hadley Wickham had...@rice.edu wrote:
Hi all,
I'm trying to understand how the search path and namespaces interact.
For example, take the devtools package which suggests the testthat
package. Here's what the search path looks like after I load each of
those
With a small risk of being incorrect (and the chance of learning
something new), I'll give it a try:
A search for a functions/objects/... that is not in the same package
environment is done in the order that the search() path gives. The
exception to this iff your package has a namespace,
Well, that's what I thought too. But:
parents - function(x) {
if (identical(x, emptyenv())) return()
c(environmentName(x), parents(parent.env(x)))
}
parents(as.environment(package:devtools))
[1] package:devtools package:methods Autoloads base
And package:testthat isn't listed
On 11/15/2010 04:56 PM, Hadley Wickham wrote:
Well, that's what I thought too. But:
parents - function(x) {
if (identical(x, emptyenv())) return()
c(environmentName(x), parents(parent.env(x)))
}
parents(as.environment(package:devtools))
[1] package:devtools package:methods Autoloads
Hadley Wickham wrote:
Hi all,
I'm trying to understand how the search path and namespaces interact.
For example, take the devtools package which suggests the testthat
package. Here's what the search path looks like after I load each of
those packages:
Luke Tierney wrote up a nice description
1.6 of Writing R Extensions says
Note that adding a name space to a package changes the search strategy.
The package name space comes first in the search, then the imports, then
the base name space and then the normal search path.
I'm not sure of the details, but I think
Hi Duncan: Luke's article is in the June, 2003 edition of R-news
On Mon, Nov 15, 2010 at 8:43 PM, Duncan Murdoch murdoch.dun...@gmail.comwrote:
Hadley Wickham wrote:
Hi all,
I'm trying to understand how the search path and namespaces interact.
For example, take the devtools package which
Ben Bolker bbolker at gmail.com writes:
Ben Bolker bbolker at gmail.com writes:
Can simplify this still farther:
a b'c
d e'f
g h'i
This example file leads to duplicate lines.
Arguably it should have behavior analogous to:
scan(what=)
1: a b'c
3: d e'f
5: g h'i
7: Read 6
22 matches
Mail list logo