similar to: R strings from C

Displaying 20 results from an estimated 900 matches similar to: "R strings from C"

2002 Mar 02
1
accessing factor levels from C
Hi, I am trying to get information about factors from a C-program. As I see, the factors are basically integers with attribute ,,levels''. But unfortunately I am not been able to read the levels information. I am using: SEXP variable, levels; ... variable = VECTOR_ELT( data_frame, j); switch( TYPEOF( variable)) { case INTSXP: if( isFactor( VECTOR_ELT( data_frame,
2017 Feb 20
1
another fix for R crashes under enable-strict-barrier, lto, trunk@72156
On 2nd thought, I think a better fix to the segfault is something like this: --- a/src/main/memory.c +++ b/src/main/memory.c @@ -3444,6 +3444,8 @@ R_xlen_t (XTRUELENGTH)(SEXP x) { return XTRUELENGTH(CHK2(x)); } int (IS_LONG_VEC)(SEXP x) { return IS_LONG_VEC(CHK2(x)); } const char *(R_CHAR)(SEXP x) { + if(!x) + error("de-referncing null. Check the validity of your data.");
2017 Feb 11
1
another fix for R crashes under enable-strict-barrier, lto, trunk@72156
I haven' t touched R for some 18 months, and so I have no idea if this is a recent problems or not; but it certainly did not segfault two years ago. Since it has been crashing (segfault) under 'make check-all' for over a month, I reckon I'll have to look at it myself, to have it fixed. I have been having the ' --enable-memory-profiling --enable-strict-barrier
2007 Sep 04
6
[LLVMdev] [PATCH]: Add SparseBitmap implementation
On 9/4/07, Dan Gohman <djg at cray.com> wrote: > On Tue, Sep 04, 2007 at 10:35:10AM -0400, Daniel Berlin wrote: > > On 9/4/07, Dan Gohman <djg at cray.com> wrote: > > > On Fri, Aug 31, 2007 at 08:10:33PM -0400, Daniel Berlin wrote: > > > > + template <int ElementSize> > > > > + class SparseBitmap { > > > > > > Do you
2007 Sep 07
0
[LLVMdev] [PATCH]: Add SparseBitmap implementation
On Tue, 4 Sep 2007, Daniel Berlin wrote: >> insert/push_back without making copies. Either of these approaches would >> also fix what looks like a leak in operator&=, where elements are erased >> from the list without being deleted. > > I seriously considered not using indirection, but it made a lot of the > functions more annoying, and it didn't seem worth the
2012 May 07
0
R CMD check, interfacing c++ linking errors
Hi there, I am trying to interface c++ code in R and make a package. With R CMD SHLIB the dll was created, but when I try R CMD check, I am getting 'undefined reference to..' linkage error messages. The relevant c++ source from conf-infomap.cpp: #include "conf-infomap.h" #include "R.h" // R functions #include "Rinternals.h" #include "Rmath.h" //
2012 May 08
0
R CMD check, c++ source linking errors
Hi there, I'm sorry if I a send it for second time, I've just subscribed for the list. I am trying to interface c++ code in R and make a package. With R CMD SHLIB the dll was created, but when I try R CMD check, I am getting 'undefined reference to..' linkage error messages. The relevant c++ source from conf-infomap.cpp: #include "conf-infomap.h" #include
2012 May 08
1
R CMD check linking errors, when interfacing c++
Hi there, I am trying to interface c++ code in R and make a package. With R CMD SHLIB the dll was created, but when I try R CMD check, I am getting 'undefined reference to..' linkage error messages. The relevant c++ source from conf-infomap.cpp: #include "conf-infomap.h" #include "R.h" // R functions #include "Rinternals.h" #include "Rmath.h" //
2003 Nov 12
5
repeat until function
Hi, I'm in this situation: I what to generate N random numbers(integer) that are different from each other. One suggestion: tabel <- rep(NULL, N) for (i in 1:N){ temp <- as.integer(runif(1,1,max)) if(temp in tabel) { repeat (?) (temp <- as.integer(runif(i,i,max))) until (?) ((temp in tabel) ==FALSE) } else{ tabel[i] <- temp} I can't use
2008 Apr 27
1
parallel max, min, and median of dataframe columns
Hello, all, I have a dataframe of three rows and umpteen columns. I want to show the maximum, minimum, and median with a vertical line and a central dot (I'd use a boxplot, but with only three data points, that's overkill; I can't just use points, because of overlap and some of the other data plotted on the graph). This works: > boxplot(data_frame,
2005 Aug 16
1
predict nbinomial glm
Dear R-helpers, let us assume, that I have the following dataset: a <- rnbinom(200, 1, 0.5) b <- (1:200) c <- (30:229) d <- rep(c("q", "r", "s", "t"), rep(50,4)) data_frame <- data.frame(a,b,c,d) In a first step I run a glm.nb (full code is given at the end of this mail) and want to predict my response variable a. In a second step, I would
2008 Aug 13
1
need help with stat functions(like adaboost, random forests and glm)
Ok, so basically I have a dataframe named data_frame data_frame contains: startdate startprice endpricethreshold1 endpricethreshold2 endpricethreshold3 all of these endpricethresholds are true/false binary vectors. They are true or false depending on whether the endprice was above or below whatever the endpricethreshold is. now I want to try to use lets say the general linear model to have
2008 Jul 17
2
AIX 5.3 --enable-R-shlib --with-x ---with-iconv make error with R-2.7.0 and R-2.7.1
Hi guys, I am trying to compile a 64bit version of R 2.7.0 on AIX 5.3. And I am running into some troubles. I also try the latest version 2.7.1 and get the very similar errors. The machine info: ----------------------- $uname -srvp AIX 3 5 powerpc ---------------------- My configuration is this: ---------------------------------------------------------- ./configure \
2006 Jan 24
1
No scientific notation in format
Hi I have a data.frame with the following numbers (first column are month numbers) 07,0,0,0,0.315444056314174,0,0,0,12.5827462764176,0.079194498691732, 0.0280828101707015,0,0.0695808222378877 08,0,0,105600,0.393061160316545,0,0,0,8.95551253153947,0.0880023174276553, 0.285714285714286,0,0.0669139911789158 09,0,0,0,0,12.5,0,0,13.5135887094281,0.0557531529154668,0,0, 0.0487526139182026
2009 Jul 02
3
Testing for membership in an array of strings
As an R beginner, I feel brain dead today as I can not find the answer to a relatively simple question. Given a array of string values, for example lets say "mary", "bob", "danny", "sue", and "jane". I am trying to determine how to perform a logical test to determine if a variable is an exact match for one of the string values in the array
2002 Jan 02
1
Building R-1.4 on Tru64
Hello everyone, I've just attempted to build R-1.4 on Compaq Tru64 (I'll enclose the text from bug.report() from R-1.3.1 at the end.) The relevant part of the log is below. Any ideas? gcc -shared -o methods.so do_substitute_direct.o methods_list_dispatch.o method_meta_data.o slot.o -L/usr/local/lib /usr/ucb/ld: Warning: Unresolved: TYPEOF Rf_error Rf_protect Rf_substitute
2010 Feb 22
1
shash in unique.c
Looking at shash in unique.c, from R-2.10.1 I'm wondering if it makes sense to hash the pointer itself rather than the string it points to? In other words could the SEXP pointer be cast to unsigned int and the usual scatter be called on that as if it were integer? shash would look like a slightly modified version of ihash like this : static int shash(SEXP x, int indx, HashData *d) {
2007 Sep 06
1
the survey package
Good afternoon! I'm trying to use the survey package to get a better point of view for my data, but i need some piece of advice: i have some data from a survey which has been stratified using 2 criteria: region(7 values), size of locality(5 values) Using the survey pakage how can i define in a correct way this design (taking into account all 4 strata not just one as in the Survey
2012 Jan 01
1
empty files created with trellis xyplot jpeg device
New years greetings. I have been setting up a function to generate multiple jpeg charts. When the calls are issued at the interactive console, the jpeg files are generated without an issue. When I try to issue the same calls from a function, some chart files are empty. It appears to only be related to trellis charts. Any help to troubleshoot this is appreciated. Regards, -mike R version
2017 Nov 08
2
Ggplot error
Hello, I've an error recently. ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line() Error: Found object is not a stat. > sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.3 LTS Matrix products: default BLAS: /usr/lib/openblas-base/libblas.so.3 LAPACK: /usr/lib/libopenblasp-r0.2.18.so locale: [1] LC_CTYPE=tr_TR.UTF-8