search for: x_r

Displaying 7 results from an estimated 7 matches for "x_r".

Did you mean: _r
2008 Jul 20
1
garbage collection, "preserved" variables, and different outcome depending on "--verbose" or not
...graphics grDevices utils datasets methods base ### -- file test.R dyn.load("test_lostobject.so") x = .Call("lostobject", as.integer(5)) x[1:3] ### --- ###--- file lostobject.c #include <R.h> #include <Rdefines.h> SEXP createObject(void) { SEXP x_R; int len_x = 1000000; PROTECT(x_R = allocVector(REALSXP, len_x)); Rprintf("Created 'x' at %p\n", x_R); Rprintf(" (mode is %i, length is %i)\n", TYPEOF(x_R), LENGTH(x_R)); Rprintf(" (first element is %d)\n", REAL(x_R)[0]); R_PreserveObject(x_R);...
2009 Jun 26
1
bug in Rf_PrintValue ?
...I change it from "coverage" to, say, "COVERAGE", the segfault does not occur. /* bug.c */ #include <stdio.h> #include <Rinternals.h> #include <Rembedded.h> int main(int argc, char **argv) { char *x = "foo"; char *y = "coverage"; SEXP x_r, y_r; Rf_initEmbeddedR(argc, argv); PROTECT( x_r = mkChar( x ) ); Rf_PrintValue( x_r ); printf( "OK\n" ); PROTECT( y_r = mkChar( y ) ); Rf_PrintValue( y_r ); printf( "OK\n" ); UNPROTECT( 2 ); return 0; } I compile this code with: % env -i PATH=/bin:/usr/bi...
2010 Sep 01
2
invert order
Dear R-help list users, I have a huge vector of numbers, how I can invert orden? For example x <- 1:10000000 I would like to obtain x_r <- 10000000:1 Thanks, Sebastian.
2013 Aug 27
1
Error in simulation. NAN
...SEXP n_j_r,SEXP J_r, SEXP prior_alpha_r,SEXP prior_rho_r,SEXP prior_sigma2_r,SEXP prior_phi_r,SEXP prior_zeta2_r, SEXP sdprop_rho_r,SEXP sdprop_sigma2_r, SEXP start_alpha_r,SEXP start_mu_r,SEXP start_rho_r,SEXP start_sigma2_r,SEXP start_k_r,SEXP start_phi_r, SEXP start_zeta2_r, SEXP x_r,SEXP H_r, SEXP acceptratio_r // SEXP Sigma_adapt_sp_r, SEXP mean_adapt_sp_r, SEXP sim_acc_sp_r, SEXP ep_sp_r, SEXP acc_index_sp_r, // SEXP Sigma_adapt_k_r, SEXP mean_adapt_k_r, SEXP sim_acc_k_r, SEXP ep_k_r, SEXP acc_index_k_r // ){ /*****************************************...
2017 May 31
2
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
Le 31/05/2017 ? 17:30, Serguei Sokol a ?crit : > > More thorough reading revealed that I have overlooked this phrase in the > line's doc: "left and right /thirds/ of the data" (emphasis is mine). Oops. I have read the first ref returned by google and it happened to be tibco's doc, not the R's one. The layout is very similar hence my mistake. The latter does not
2017 May 31
0
stats::line() does not produce correct Tukey line when n mod 6 is 2 or 3
...ore; In this case, interestingly, you need one of those I think - almost everything I found online did not have the exact details. Peter Dalgaard definitely was right that Tukey did not use quantiles at all, and notably did *not* define the three groups via {i; x_i <= x_L} and {i; x_i >= X_R} which (as I think you noticed) may make the groups quite unbalanced in case of duplicated x's. But then, for now I had decided to fix the bug (namely computing the x-medians wrongly as you diagnosed correctly(!) -- but your first 2 patches only fixed partly) *and* go at least one step in the...
2006 Feb 09
0
(no subject)
...) ...\bin\R CMD SHLIB X.cc X_main.cc or (VC++, which requires extension .cpp) cl /MT /c X.cpp X_main.cpp link /dll /out:X.dll /export:X_main X.obj X_main.obj or (Borland C++, which also requires extension .cpp) bcc32 -u- -WDE X.cpp X_main.cpp and call the entry point(s) in X_R, such as X_main. Construction of static variables will occur when the DLL is loaded, and destruction when the DLL is unloaded, usually when R terminates. Note that you will not see the messages from this example in the GUI console: see the next section. This example used to be in package cxx_0....