search for: getsrcref

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

2023 Feb 05
1
R2HTML doesn't split paragraphs originating from \Sexpr[results=rd]
...ed by a \Sexpr. This happens because utils:::getSrcByte() not 1 for these blank lines. That, in turn, is because the source reference for \Sexpr values is the whole \Sexpr tag: # blank line from a \Sexpr Rd[[3]][[2]][[9]][[2]] # [1] "\n" # attr(,"Rd_tag") # [1] "TEXT" getSrcref(Rd[[3]][[2]][[9]][[2]]) # \Sexpr[stage=render,results=rd]{ # paste( # rep('Sexpr: This should be on a separate paragraph', 3), # collapse = '\n\n' # ) # } # artisanal hand-crafted blank line Rd[[3]][[2]][[7]] # [1] "\n" # attr(,"Rd_tag") # [1] "...
2014 Mar 05
1
[PATCH] Code coverage support proof of concept
...ther people are interested. Usage -------- Rcov_start() # your code to trace here res <- Rcov_stop() res is currently a hashed env, with traced source filenames associated with 2-columns matrices holding the line numbers and their frequencies. How it works ----------------- I added a test in getSrcref(), that records the line numbers if code coverage is started. The overhead should be minimal since for a given file, subsequent covered lines will be stored in constant time. I use a hased env to store the occurrences by file. I added two entry points in the utils package (Rcov_start() and Rcov_st...
2014 Jan 07
1
Why do methods of "initialize" have no "srcref" attribute as other S4 mehtods?
For documentation we use a system that generates Rd files from special comments in the code. (inlinedocs). It is crucial to be able to get the defining source code for objects like methods to extract the comments from it. Here is an R session that shows how this works for several kinds of methods and (at the end of the session) how if fails for methods of "initialize" >
2012 Jul 18
1
Changes to parser in R-devel
I have just committed (in r59883) some changes to the R parser based on Romain Francois' parser package. Packages that made use of parser will hopefully find that the information in base R gives them what they need to work with, but the data is not identical to what parser recorded (since it was not consistent with some things already in R). One reason for the change was that the parser
2011 Apr 13
0
R 2.13.0 is released
...rom a function. ? "srcref" attributes now include two additional line number values, recording the line numbers in the order they were parsed. ? New functions have been added for source reference access: getSrcFilename(), getSrcDirectory(), getSrcLocation() and getSrcref(). ? Sys.chmod() has an extra argument use_umask which defaults to true and restricts the file mode by the current setting of umask. This means that all the R functions which manipulate file/directory permissions by default respect umask, notably R CMD INSTALL. ? t...
2011 Apr 13
0
R 2.13.0 is released
...rom a function. ? "srcref" attributes now include two additional line number values, recording the line numbers in the order they were parsed. ? New functions have been added for source reference access: getSrcFilename(), getSrcDirectory(), getSrcLocation() and getSrcref(). ? Sys.chmod() has an extra argument use_umask which defaults to true and restricts the file mode by the current setting of umask. This means that all the R functions which manipulate file/directory permissions by default respect umask, notably R CMD INSTALL. ? t...
2010 Sep 03
1
Fourteen patches to speed up R
I've continued to work on speeding up R, and now have a collection of fourteen patches, some of which speed up particular functions, and some of which reduce general interpretive overhead. The total speed improvement from these patches is substantial. It varies a lot from one R program to the next, of course, and probably from one machine to the next, but speedups of 25% can be expected in