similar to: internal and external debugging [was: [R] step by step debugger in R?]

Displaying 20 results from an estimated 20000 matches similar to: "internal and external debugging [was: [R] step by step debugger in R?]"

2009 Feb 12
1
Why is srcref of length 6 and not 4 ?
Hello, Consider this file (/tmp/test.R) : <file> f <- function( x, y = 2 ){ z <- x + y print( z ) } </file> I get this in R 2.7.2 : > p <- parse( "/tmp/test.R" ) > str( attr( p, "srcref" ) ) List of 1 $ :Class 'srcref' atomic [1:4] 1 1 4 1 .. ..- attr(*, "srcfile")=Class 'srcfile' length 4 <environment>
2011 May 26
1
serialization of external pointers
Hello, I'm looking for examples of how to handle serialization of external pointers. We use external pointers intensively in Rcpp for modules and one popular request is to have persistence. And I guess we need to be able to serialize/deserialize external pointers for this. Also, module objects are all instances of reference classes, so maybe that can be handled at the R level ? Romain
2009 Mar 20
2
Why does the lexical analyzer drop comments ?
It happens in the token function in gram.c:     c = SkipSpace();     if (c == '#') c = SkipComment(); and then SkipComment goes like that: static int SkipComment(void) {     int c;     while ((c = xxgetc()) != '\n' && c != R_EOF) ;     if (c == R_EOF) EndOfFile = 2;     return c; } which effectively drops comments. Would it be possible to keep the information
2010 Jun 18
2
nchar( NA )
Hello, Is this expected ? > nchar( c( "", NA ) ) [1] 0 2 Should not the second one be NA ? Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/98Uf7u : Rcpp 0.8.1 |- http://bit.ly/c6YnCi : graph gallery collage `- http://bit.ly/bZ7ltC : inline 0.3.5
2011 May 31
1
assignInNamespace and new bindings
Hello, assignInNamespace refuses to assign an object to a name that is not already used in the namespace. Something like this would make it possible: --- src/library/utils/R/objects.R (revision 56024) +++ src/library/utils/R/objects.R (working copy) @@ -252,8 +252,9 @@ stop("environment specified is not a package") ns <- asNamespace(substring(nm, 9L))
2010 May 29
3
S4 dispatch for .DollarNames (utils)
Hello, I'm trying to make .DollarNames generic and implement a method for it in a package. .DollarNames is the function that is now called to get completion possibilities. My R code looks like this: setGeneric( ".DollarNames" ) setClass("track", representation(x="numeric", y="numeric")) ## A class extending the previous, adding one more
2013 Nov 16
2
serialization for external pointers
Hello, Are there any recipe to handle serialization / deserialization of external pointers. I'm thinking about something similar in spirit to the way we handle finalization of external pointers. Currently, if we create an external pointer, save the session, quit R, then load the session, we get a null pointer. One way I'm thinking of is to have an environment in the
2009 Jul 02
1
package post install instructions
Hello, I've looked in tools:::.install_packages for some sort of hook that would let packages developers point to further instructions after a package is installed. For example, some packages need to setup environment variables, ... Is there something I have missed ? Romain -- Romain Francois Independent R Consultant +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |-
2009 Dec 15
1
S4 dispatch and S3 "connection" objects
Hello, I'm trying to get S4 dispatch on S3 "connection" objects. So I do : setOldClass( "connection" ) and then : setGeneric( "bling", function(object) standardGeneric( "bling" ) ) setMethod( "bling", "connection", function(object) cat( "gotcha ", as.integer(object), "\n" ) ) but I get : f <- file(
2010 Mar 07
1
duplicate STRSXP : shallow copy ?
Hello, As this little program illustrates, duplicating a STRSXP does not seem deep enough. require( inline ) fx <- cfunction( signature( x = "character"), ' SEXP y = PROTECT( duplicate( x ) ); int n = LENGTH(x); int nc = 0 ; char* p = 0 ; for( int i=0; i<n; i++){ p = (char*)( CHAR( STRING_ELT( y , i ) ) ); nc = strlen( p ) ; for( int j=0; j<nc; j++){ p[j] =
2009 Oct 09
1
celebrating revision 50000
Hello, Today, Brian Ripley commited the revision 50000 of R's svn repository. I took this as an opportunity to do some data analysis of the log and posted some code and graphics on my blog: http://romainfrancois.blog.free.fr/index.php?post/2009/10/09/celebrating-R-commit-50000 The plots of the number of commits per day (and per month) indicates a peak in 2002. Here are the top 20
2009 Dec 15
2
split.data.frame
Hello, I very much enjoy "with" and "subset" semantics for data frames and was wondering if we could have something similar with split, basically by evaluating the second argument "with" the data frame : split.data.frame function(x, f, drop = FALSE, ...){ call <- match.call( ) fcall <- call( "with", data = call[["x"]],
2009 Aug 05
1
exec subdirectory of a package
Hello, WRE contains the following information about the "exec" subdirectory of a package : "Subdirectory exec could contain additional executables the package needs, typically scripts for interpreters such as the shell, Perl, or Tcl. This mechanism is currently used only by a very few packages, and still experimental." I think it would be useful to expand "very
2009 Jun 18
1
R_parseVector and syntax error [was: error messages while parsing with rniParse]
Hello, [I'm redirecting this here from stats-rosuda-devel] When parsing R code through R_parseVector and the code generates an error (syntax error), is there a way to grab the error. It looks like yyerror populates the buffer "R_ParseErrorMsg", but then the variable is not part of the public api. Would it be possible to add yet another entry point to the parser that would
2011 Jan 11
1
as.environment.list provides inconsistent results under torture
Hello, Using R-devel (rev 53950), I get inconsistent results with as.environment( VECSXP ) when gctorture is on. Consider: a <- list( aa = rnorm, bb = runif ) gctorture(TRUE) as.environment( a ) The last line sometimes produces the correct environment, but sometimes I get errors. Here are the three situations: # good > as.environment( a ) <environment: 0x100b1c978> # not good
2009 Nov 07
1
getConnection, R_outpstream_st
Hello, I'm trying to use the limited connections api defined in Rinternals.h. I have code that looks like this (inspired from do_serializeToConn) : SEXP serialize_to_connection( SEXP xp, SEXP connection ){ Rconnection con ; struct R_outpstream_st out; R_pstream_format_t type = R_pstream_binary_format ; SEXP (*hook)(SEXP, SEXP) = NULL ; con = getConnection(Rf_asInteger(connection));
2010 Feb 11
2
LinkingTo and C++
Hello, I've been trying to make LinkingTo work when the package linked to has c++ code. I've put dumb packages to illustrate this emails here ; http://addictedtor.free.fr/misc/linkingto Package A defines this C++ class: class A { public: A() ; ~A() ; SEXP hello() ; } ; Package B has this function : SEXP say_hello(){ A a ; return a.hello() ; } headers of package A are copied
2009 Oct 10
1
isFALSE
Hello, Just wondering why there is "isTRUE" and not "isFALSE". Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/BcPw : celebrating R commit #50000 |- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc `- http://tr.im/yw8E : New R package : sos -------------- next part -------------- An
2009 Mar 03
1
profiler and loops
Hello, (This is follow up from this thread: http://www.nabble.com/execution-time-of-.packages-td22304833.html but with a different focus) I am often confused by the result of the profiler, when a loop is involved. Consider these two scripts: script1: Rprof( ) x <- numeric( ) for( i in 1:10000){ x <- c( x, rnorm(10) ) } Rprof( NULL ) print( summaryRprof( ) ) script2:
2013 Dec 12
2
internal manipulation of ...
Hello, I?m looking for examples on how to manipulate the ... internally, e.g. in a .Call or .External function. I?m particularly interested in accessing the environment in which each contribution to ... can be evaluated. So far, I?m using tricks involving passing down the sys.calls() and sys.frames() down to the C function. The documentation in