search for: mkstring

Displaying 20 results from an estimated 67 matches for "mkstring".

Did you mean: mbstring
1999 Nov 23
1
compile error for mkString on alpha (PR#332)
Full_Name: Albrecht Gebhardt Version: 0.90.0 OS: osf4.0 Submission from: (NULL) (143.205.61.73) I had to apply the following patch to be able to compile on an alpha with DU 4.0E: ############################################### --- ./src/main/gram.y.mkString-patch Tue Nov 23 12:16:29 1999 +++ ./src/main/gram.y Tue Nov 23 12:16:59 1999 @@ -56,7 +56,8 @@ SEXP mkFloat(char *); SEXP mkInteger(char *); SEXP mkNA(void); -SEXP mkString(const char *); +typedef const char cchar; +SEXP mkString(cchar *);...
2016 May 24
2
Suggestion: mkString(NULL) should be NA
On Tue, May 24, 2016 at 9:30 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> wrote: > On Tue, May 24, 2016 at 5:59 PM, Gabriel Becker <gmbecker at ucdavis.edu> > wrote: > > Shouldn't Rf_mkString(NULL) return (the c-level equivalent of) > character() > > rather than the NA_character_? > > No. It should still be safe to assume that mkString() always returns a > character vector of exactly length one. Anything else could lead to > type errors. > Well the thing is you...
2016 May 24
2
Suggestion: mkString(NULL) should be NA
Shouldn't Rf_mkString(NULL) return (the c-level equivalent of) character() rather than the NA_character_? An empty string and NULL aren't the same. It seems reasonable for Rf_mkChar to give NA_character_ though. ~G On Tue, May 24, 2016 at 8:42 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> wrote: > On Th...
2016 May 25
0
Suggestion: mkString(NULL) should be NA
...on Tue, 24 May 2016 10:30:48 -0700 writes: > On Tue, May 24, 2016 at 9:30 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> > wrote: >> On Tue, May 24, 2016 at 5:59 PM, Gabriel Becker <gmbecker at ucdavis.edu> >> wrote: >> > Shouldn't Rf_mkString(NULL) return (the c-level equivalent of) >> character() >> > rather than the NA_character_? >> >> No. It should still be safe to assume that mkString() always returns a >> character vector of exactly length one. Anything else could lead to &...
2009 Sep 16
2
I want to get a reference to this time series object
...<Rembedded.h> int main(int argc, char** argv) { SEXP e,c,portSpec,portData,portConstr,portVal,tsAssets; int errorOccurred,nx,ny,i,j; double *v; const char *x,*y; Rf_initEmbeddedR(argc, argv); // loading fPortfolio PROTECT(e = lang2(install("library"), mkString("fPortfolio"))); R_tryEval(e, R_GlobalEnv, NULL); UNPROTECT(1); // creating a default portfolioSpec object PROTECT(e=lang1(install("portfolioSpec"))); PROTECT(portSpec=R_tryEval(e,R_GlobalEnv, NULL)); // creating a portfolioData object PROTECT(e=lang...
2016 May 12
3
Suggestion: mkString(NULL) should be NA
I would like to propose that Rf_mkString(NULL) and Rf_mkChar(NULL) return NA rather than segfault. Case: the mkString() and mkChar() functions are convenient to wrap strings returned by e.g. external C libraries into an R vector. However sometimes a library returns NULL instead of a string when the result is unavailable. In some C librar...
2016 May 25
2
Suggestion: mkString(NULL) should be NA
...is an accident of some kind if they got NULL, no? Not necessarily. A char* of NULL can be a string which is not initiated or simply unavailable due to configuration. The example from my original email was in curl package which exposes the version string of libz that was used to build libcurl: mkString(data->libz_version) This worked on all platforms that I tested. However a user found that if libcurl was configured --without-libz (which is uncommon) the libz_version string does not get set by libcurl and is always NULL. I had not foreseen this and it would lead to a segfault. I think making...
1999 Nov 26
2
compiling R-0.90.0 on alpha-dec-osf4.0
I am compiling R-0.90.0 on alpha-dec-osf4.0 and it stops by giving the following message: cc: Error: ../../../R/src/main/gram.y, line 1365: In this declaration, parameter 1 has a different type than specified in an earlier declaration of this function. SEXP mkString(const char *s) -----^ cc: Error: ../../../R/src/main/gram.y, line 1365: In this declaration, the type of "mkString" is not compatible with the type of a previous declaration of "mkString" at line number 378 in file ../include/Rinternals.h. SEXP mkString(const char *s) -----^ gma...
1999 Nov 26
2
compiling R-0.90.0 on alpha-dec-osf4.0
I am compiling R-0.90.0 on alpha-dec-osf4.0 and it stops by giving the following message: cc: Error: ../../../R/src/main/gram.y, line 1365: In this declaration, parameter 1 has a different type than specified in an earlier declaration of this function. SEXP mkString(const char *s) -----^ cc: Error: ../../../R/src/main/gram.y, line 1365: In this declaration, the type of "mkString" is not compatible with the type of a previous declaration of "mkString" at line number 378 in file ../include/Rinternals.h. SEXP mkString(const char *s) -----^ gma...
2016 May 25
0
Suggestion: mkString(NULL) should be NA
...got NULL, no? > > Not necessarily. A char* of NULL can be a string which is not > initiated or simply unavailable due to configuration. > > The example from my original email was in curl package which exposes > the version string of libz that was used to build libcurl: > > mkString(data->libz_version) > > This worked on all platforms that I tested. However a user found that > if libcurl was configured --without-libz (which is uncommon) the > libz_version string does not get set by libcurl and is always NULL. I > had not foreseen this and it would lead to a s...
2001 Mar 07
1
mkString (PR#866)
Full_Name: Tim Keitt Version: 1.2x OS: Linux Submission from: (NULL) (129.49.19.70) The function "mkString" declared in "Rinternals.h" dumps core if passed a NULL pointer. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscri...
1999 Nov 13
0
patches for alpha
...2,8 @@ AC_TRY_RUN( changequote(<<, >>)dnl << - #include <math.h> - #include <ieeefp.h> +# include <math.h> +# include <ieeefp.h> int main () { double x = 0; fpsetmask(0); x = x / x; return (x != x); 3. multiple declaration of mkString, const char* did not work: cc: Error: ../../../R/src/main/gram.y, line 1365: In this declaration, parameter 1 has a different type than specified in an earlier declaration of this function. (mismatparam) SEXP mkString(const char *s) Also another "#" not in column 1. One solution is the...
2009 Sep 29
3
How do I access class slots from C?
...har** argv) { SEXP e,c,portSpec,portData,portConstr,portVal,portWeights,tsAssets,tsReturns,nAssets,reciprocal; int errorOccurred,nx,ny,i,j; double *v; const char *x,*y; Rf_initEmbeddedR(argc, argv); // loading fPortfolio PROTECT(e = lang2(install("library"), mkString("fPortfolio"))); R_tryEval(e, R_GlobalEnv, NULL); UNPROTECT(1); // creating a default portfolioSpec object PROTECT(e=lang1(install("portfolioSpec"))); PROTECT(portSpec=R_tryEval(e,R_GlobalEnv, NULL)); // creating a portfolioData object PROTECT(e=lang...
2016 May 25
0
Suggestion: mkString(NULL) should be NA
On Wed, 25 May 2016, Tim Keitt wrote: > On Wed, May 25, 2016 at 7:22 AM, Michael Lawrence <lawrence.michael at gene.com >> wrote: > >> On Wed, May 25, 2016 at 4:23 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> >> wrote: >> > > I'm not disagreeing with what's been said in this thread, but I can't help > but recall that I brought up this
2014 Oct 31
3
ScalarLogical and setAttrib
...function below returns FALSE and 'test2' returns FALSE with an attribute: library(inline) test1 <- cfunction(body = 'return ScalarLogical(0);') test2 <- cfunction(body = ' SEXP success = PROTECT(ScalarLogical(0)); setAttrib(success, install("foo"), mkString("bar")); UNPROTECT(1); return success; ') However after running test2(), then test1() will also return the attribute: > test1() [1] FALSE > test2() [1] FALSE attr(,"foo") [1] "bar" > test1() [1] FALSE attr(,"foo")...
2005 Aug 26
1
wchar and wstring.
...all, I am writing an R interface to some C++ files which make use of std::wstring classes for internationalization. Previously (when I wanted to make R strings from C++ std::strings), I would do something like this to construct a string in R from the results of the parse. SET_VECTOR_ELT(vals, i++, mkString(header.GetHeader().c_str())); However, now the call header.GetHeader().c_str() returns a pointer to an array of wchar_t's. I was going to use wcstombs() to convert the wchar_t* to char*, but I wanted to see if there was a similar function in R for the mkString function which I had initially u...
2016 May 25
3
Suggestion: mkString(NULL) should be NA
On Wed, May 25, 2016 at 7:22 AM, Michael Lawrence <lawrence.michael at gene.com > wrote: > On Wed, May 25, 2016 at 4:23 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu> > wrote: > I'm not disagreeing with what's been said in this thread, but I can't help but recall that I brought up this exact issue probably 15 years ago and was told (by Brian, I believe)
2000 Sep 07
1
getAttrb - Solved
Hi, I changed INTEGER(getAttrib(shape,mkChar("nParts")))[0] to INTEGER(getAttrib(shape,mkString("nParts")))[0] and now it works fine. Nicholas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the &quot...
2005 Jul 15
0
[R] Passing character strings from C code to R
...directly and for which STRING_ELT is inappropriate.) You want something like (PROTECTS omitted): Str = allocVector(STRSXP, 1); SET_STRING_ELT(Str, 0, mkChar(comment)); There are many similar examples in the R sources for you to browse. There is even a shortcut that manages the PROTECTS, Str = mkString(comment); (That allocString and mkString return different types indicate why I wrote `whatever that is': the term is too loose to be useful.) So you could just have if(comment && strlen(comment) setAttrib(Ret, install("com"), mkString(comment)); if(comment) Free(comment...
2007 Aug 16
0
call R function in c++ program
...t++) { REAL(vector_SEXP)[i] = (double) *s_it; i++; } UNPROTECT(1); // for create a variable in R environement defineVar(install("variable_name"), variable_value_SEXP, rho); // for execute "complex" function (with parser) PROTECT( e1 = mkString("plot(variable_name, type=\"l\")") ); PROTECT( e2 = R_ParseVector(e1, 1, &status, R_NilValue) ); R_tryEval(VECTOR_ELT(e2,0), rho, &hadError); UNPROTECT(2); // for execute "simple" function (without parser) PROTECT( e1 = lang3(install("...