similar to: Evaluate values in `Sys.setenv`

Displaying 20 results from an estimated 6000 matches similar to: "Evaluate values in `Sys.setenv`"

2020 Aug 28
0
Evaluate values in `Sys.setenv`
It is the shell that does the ~ and $ expansions, and Sys.setenv() doesn't go via the shell, so you cannot expect it to understand the shell metacharacters. Instead, you need to do the corresponding computations in R, e.g. > paste(path.expand("~/mypath"), Sys.getenv("PATH"), sep=":") [1]
2019 Sep 23
2
What is the best way to loop over an ALTREP vector?
Sorry for post a lot of things, for the first part of code, I copied my C++ iter macro by mistake(and you can see an explicit type casting). Here is the macro definition from R_exts/Itermacros.h #define ITERATE_BY_REGION_PARTIAL(sx, px, idx, nb, etype, vtype, \ strt, nfull, expr) do { \ * const** etype *px = DATAPTR_OR_NULL(sx); *
2020 Oct 19
2
Is there any way to check the class of an ALTREP?
Hi all, I would like to determine if an ALTREP object is from my package, I see there is a function `ALTREP_CLASS` defined in RInternal.h but its return value is neither a `R_altrep_class_t` object nor an STRSXP representing a class name. I do not know how to correctly use it. Any suggestions? Thanks, Jiefei [[alternative HTML version deleted]]
2019 Aug 28
3
What is the best way to loop over an ALTREP vector?
Hi devel team, I'm working on C/C++ level ALTREP compatibility for a package. The package previously used pointers to access the data of a SEXP, so it would not work for some ALTREP objects which do not have a pointer. I plan to rewrite the code and use functions like get_elt, get_region, and get_subset to access the values of a vector, so I have a few questions for ALTREP: 1. Since an
2020 Oct 19
2
Is there any way to check the class of an ALTREP?
Benjamin, You happened to send a link which points to the OP's own package :) I think Jiefei would like to know how one can "officially" determine if an arbitrary ALTERP object belongs to a class that he owns. Regards, Denes On 10/19/20 10:22 AM, Benjamin Christoffersen wrote: > It seems as if you can you use the ALTREP macro as done in this > package:
2020 Oct 19
1
Is there any way to check the class of an ALTREP?
Thank Denes for the clarification, glad to see my package got one citation from my own question:) Also, thank Benjamin for sending many useful documents. Actually, the question is related to the SharedObject package that Benjamin has pointed to. I wanna avoid sharing an object that has already been shared, so I need to check whether an object is an ALTREP that is defined in my package. Since the
2020 Oct 07
2
Coercion function does not work for the ALTREP object
Hi all, The coercion function defined for the ALTREP object will not be called by R when an assignment operation implicitly introduces coercion for a large ALTREP object. For example, If I create a vector of length 10, the ALTREP coercion function seems to work fine. ``` > x <- 1:10 > y <- wrap_altrep(x) > .Internal(inspect(y)) @0x000000001f9271c0 13 INTSXP g0c0 [REF(2)] I am
2019 Jun 18
3
Fast way to call an R function from C++?
Hi, I'm looking for a most efficient way to call an R function from C++ in a package. I know there are two functions (`R_forceAndCall` and `Rf_eval`) that can do the "call" part, but both are slow compared to calling the same function in R. I also try to use Rcpp and it is the worse one. Here is my test code: C++ code: ``` // [[Rcpp::export]] SEXP C_test1(SEXP f, SEXP x) { SEXP
2019 Sep 24
2
What is the best way to loop over an ALTREP vector?
Hi Bob, Thanks for sending around the link to that. It looks mostly right and looks like a useful onramp. There are a few things to watch out for though (I've cc'ed Romain so he's aware of these comments). @romain I hope you taake the following comments as they are intended, as help rather than attacks. The largest issue I see is that the contract for Get_region is that it *populates
2019 Jun 18
2
Fast way to call an R function from C++?
For reference, your benchmark using UNWIND_PROTECT: > system.time(test(testFunc, evn$x)) user system elapsed 0.331 0.000 0.331 > system.time(test(C_test1, testFunc, evn$x)) user system elapsed 2.029 0.000 2.036 > system.time(test(C_test2, expr, evn)) user system elapsed 2.307 0.000 2.313 > system.time(test(C_test3, testFunc, evn$x)) user system
2019 Sep 03
2
[ALTREP] What is the meaning of the return value of Is_sorted and No_NA function?
Hi, I would like to figure out the meaning of the return value of these two functions. Here are the default definitions I find from R source code: static int altreal_Is_sorted_default(SEXP x) { return UNKNOWN_SORTEDNESS; } static int altreal_No_NA_default(SEXP x) { return 0; } I guess the macro *UNKNOWN_SORTEDNESS *in *Is_sorted* and 0 in *No_NA *simply means unknown sorted/NA status of
2020 Oct 08
1
Coercion function does not work for the ALTREP object
Hi Gabriel, here is a simple package for reproducing the problem. https://github.com/Jiefei-Wang/testPkg Best, Jiefei On Thu, Oct 8, 2020 at 5:04 AM Gabriel Becker <gabembecker at gmail.com> wrote: > Jiefei, > > Where does the code for your altrep class live? > > Thanks, > ~G > > On Wed, Oct 7, 2020 at 4:25 AM Jiefei Wang <szwjf08 at gmail.com> wrote: >
2020 Mar 10
4
R CMD INSTALL cannot recognize full path on Windows
Oops, I think both of us forget to cite the r-devel channel. Best, Jiefei On Tue, Mar 10, 2020 at 5:13 AM Wang Jiefei <szwjf08 at gmail.com> wrote: > Thanks for your quick response, Tomas. > > Yes, this is a path issue, I think the problem is related to R, not the > Rtools make. I built an example package for reproducing the problem: > https://github.com/Jiefei-Wang/example
2019 May 16
3
ALTREP: Bug reports
Hello Luke and Gabriel, Thank you very much for your quick responses. The explanation of STDVEC is very helpful and I appreciate it! For the wrapper, I have a few new questions. 1. Like Luke said a mutable object is not possible. However, I noticed that there is one extra argument *deep* in the function duplicate. I've googled all the available documentation for ALTREP but I did not find
2019 Dec 08
2
What should dnorm(0, 0, -Inf) return?
Yes, that looks like a bug and an easily fixable one too. However, I spy another issue: Why do we check the !R_FINITE(x) && mu == x before checking for sd < 0 ? The difference is whether we return ML_NAN; or ML_ERR_return_NAN; but surely negative sd should always be an error? I'd be inclined to do if (sigma < 0) ML_ERR_return_NAN; if(!R_FINITE(sigma)) return R_D__0;
2017 Sep 18
1
llvm-link: Missing Dwarf DIE references
I am experiencing an issue combining bitcode files for the purpose of generating the combined bitcodes as a single bitcode file. I would like to have any pointers to help me debug this or maybe it has been seen before and a fix is either being worked on or is done. I am using the Xcode 9.0 compiler. I believe the Swift code is 3.x. I have reproduced this using the tot llvm-link. The input
2020 Apr 03
4
The finalizer of the externalPtr does not work when closing R?
Hi all, I found that the finalizer of the externalPtr is not called when R is quitting. However, manually calling GC() works fine. This behavior is observed on devel R 2020-04-02 r78142 on Win and R 3.6.3 on Ubuntu. I make a reproducible package here: https://github.com/Jiefei-Wang/example Here is the detail of how to reproduce the problem, I create a temporary file in the package root path and
2019 May 27
1
"if" function in pure R?
Thanks a lot Jiefei, I had thought of defining a binary operator (inspired by pipes) or simply using an additional condition in the if() calls [e.g. if(foo & fn(bar)) doSomeThing; with fn(bar) returning a logical], but both are workaround that I do not find as elegant as a proper control-flow construct. Thus two questions remain: - is it possible to create a control-flow construct in pure R?
2019 May 08
2
ALTREP: Design concept of alternative string
Hello from Bioconductor, I'm developing a package to share R objects across clusters using boost library. The concept is similar to mmap package: https://cran.r-project.org/web/packages/mmap/index.html . However, I have a problem when I was trying to write Dataptr_method for the alternative string. Based on my understanding, the return value of the Dataptr_method function should be a vector
2020 Mar 11
1
R CMD INSTALL cannot recognize full path on Windows
Jiefei, you did not commit all files into the example package - your example has things like RcppExports.cpp as well as additional flags which are not in your GH project. I suspect the issue is with the extra flags you're adding - those don't come from R. Please make sure you can replicate the issue with the GH package you created. Cheers, Simon * installing *source* package