similar to: incomplete results from as.character.srcref() in some cases involving quote()

Displaying 20 results from an estimated 7000 matches similar to: "incomplete results from as.character.srcref() in some cases involving quote()"

2018 Jun 20
0
incomplete results from as.character.srcref() in some cases involving quote()
wholeSrcref attribute is documented in ?parse to be the source reference corresponding to the already parsed text. The implementation in the parser matches the documentation - the code stops at the last byte/character of the expression, that is, on the closing brace - which is the "already parsed text". I think this works as documented (also source() uses the current implementation
2017 Dec 11
1
possible bug in utils::removeSource - NULL argument is silently dropped
Dear R-Core Team, I found an unexpected behaviour in utils::removeSource (also present in r-devel as of today). --- # create a function which accepts NULL argument foo <- function(x, y) { if (is.null(y)) y <- "default foo" attr(x, "foo") <- y x } # create a function which utilizes 'foo' testSrc <- function() { x <- 1:3 x <- foo(x,
2004 Aug 02
4
Is k equivalent to k:k ?
Hi, I wonder if the following (apparent) inconsistency is a bug or feature. Since scalars are simply vectors of length one I would think that a and a:a produce the same result. For example, > identical(4.01,4.01:4.01) [1] TRUE However, identical(4,4:4) [1] FALSE and > identical(4.0,4.0:4.0) [1] FALSE A closer look reveals that the colon operator produces objects
2011 Jan 05
2
convert expressions to characters
Hi, Suppose I have x = parse(text = " {y=50+50+50#'asfasf' } ") now x is an expression with some src attributes. > x expression({y=50+50+50#'asfasf' }) attr(,"srcfile") <text> attr(,"wholeSrcref") {y=50+50+50#'asfasf' } My question is, how can I get my string back (the string passed to parse() as the text argument)? >
2018 May 25
2
Rd parser throws error for user macros invoked with empty argument
While on the topic of Rd macro arguments, it seems that if a multiline argument is supplied, the lines after the first are silently ignored: f <- tempfile() mac6 <- "\\newcommand{\\mac6}{mac6: #1}" cat(mac6, "\\mac6{2*3 2+2 sin(pi) }\n", file = f) rd <- tools::parse_Rd(f) > rd mac6: 2*3 --- Georgi Boshnakov -----Original Message----- From: Tomas Kalibera
2004 Dec 08
4
Is k equivalent to k:k ?
Bringing up an old topic on a small technicality. In the help documentation on seq. Value: The result is of 'mode' '"integer"' if 'from' is (numerically equal to an) integer and 'by' is not specified. The arguement in seq specifying length also creates "double" which is not obvious in the wording, as "by" is not specified
2004 Dec 08
4
Is k equivalent to k:k ?
Bringing up an old topic on a small technicality. In the help documentation on seq. Value: The result is of 'mode' '"integer"' if 'from' is (numerically equal to an) integer and 'by' is not specified. The arguement in seq specifying length also creates "double" which is not obvious in the wording, as "by" is not specified
2018 May 14
3
Rd parser throws error for user macros invoked with empty argument
Bug or feature? I get the following error from parse_Rd() when a user Rd macro (including system ones) is invoked with empty argument {}, eg \mymacro{}: Error in tools::parse_Rd(fn) : Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'NULL' A full example is further below with the system macro \CRANpkg{}. In this example it doesn't make sense to use empty argument but
2019 Jun 28
2
tools::package_native_routine_registration_skeleton?
> ... reports that the fortran names of all the registered fortran functions are ?undocumented objects?... Those symbols should not be exported. In quantreg v5.33, NAMESPACE has 'exportPattern(".")'. Maybe it is a good time to remove that and export explicitly the symbols that are meant for export. Georgi Boshnakov ------------------------------ Message: 6 Date: Fri, 28
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>
2012 Jul 05
1
Extracting srcref for S4 methods
Hi, on R version 2.15.1 (2012-06-22) (Platform: i686-pc-linux-gnu (32-bit)) sourced functions have srcref attached as an attribute. Are such data also available for S4 generics and methods? How? (See sample code below) Thank you. Bests, Renaud f <- textConnection( " f <- function(){} setGeneric('myfun', function(x, ...) standardGeneric('myfun'))
2019 Jun 28
1
tools::package_native_routine_registration_skeleton?
On 28/06/2019 6:27 a.m., Koenker, Roger W wrote: > Thanks, I was just coming to that conclusion and beginning to look for a way to make a list of > exportable objects. After library(quantreg), ls("package:quantreg") will list all the names you currently export. So cat(ls("package:quantreg"), sep = ", ") will print the list in a form suitable for including
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" >
2020 Sep 02
3
sys.call() 's srcref doesn't match the language
Dear R-devel, I found this behavior disturbing, if `1 + f()` is called, `sys.call()` called inside of `f` will return a quoted `f()` with a "srcref" that prints "1 + f()". I don't know which one is good but I don't think they can be correct at the same time. Here's a reproducible example: f <- function(){ sc <- sys.call() print(sc) attr(sc,
2013 Dec 13
1
Proper way to drop 'srcref' from an expression created via substitute(function() ...)?
First, why does this expression have a 'srcref' element: > exprA <- substitute(function(x) a*x, list(a=2)) > print(exprA) function(x) 2 * x > str(as.list(exprA)) List of 4 $ : symbol function $ :Dotted pair list of 1 ..$ x: symbol $ : language 2 * x $ :Class 'srcref' atomic [1:8] 1 20 1 34 20 34 1 1 .. ..- attr(*, "srcfile")=Classes
2010 May 10
3
update.packages fails with directory not found
Windows XP. I have just updated to R 2.11.0 and then run update.packages. In the series of updates, a few will succeed, then I get a failure like package 'mvtnorm' successfully unpacked and MD5 sums checked package 'party' successfully unpacked and MD5 sums checked package 'PBSmodelling' successfully unpacked and MD5 sums checked Error in normalizePath(path) :
2020 Sep 11
2
more Matrix weirdness
> > "These operators are also implicit S4 generics, but as > > primitives, S4 methods will be dispatched only on S4 > > objects ?x?." > Yes, exactly, very well found, Georgi! I'm sorry Martin, but I don't understand your point here. I'm assuming that you want the (S3) matrix, x, to be converted to an (S4) Matrix. However, this is not a
2010 Jan 20
1
function curve() (PR#14191)
Full_Name: Georgi Boshnakov Version: 2.10.1pat OS: Windows XP Submission from: (NULL) (130.88.123.205) When calling programmatically function curve() from package:graphics I experienced some trouble since it reports stop("'expr' must be a function or an expression containing 'x'") even if expr is "expression". Naturally, the user message uses
2023 Feb 05
1
R2HTML doesn't split paragraphs originating from \Sexpr[results=rd]
Hello, Here's an example that renders correctly using Rd2txt / Rd2latex / R CMD Rd2pdf, but has problems under Rd2HTML: \name{foo} \title{foo} \section{foo}{ This should be on a separate paragraph This should be on a separate paragraph This should be on a separate paragraph \Sexpr[stage=render,results=rd]{ paste( rep('Sexpr: This should be on a separate
2013 Jun 24
0
sys.source() does not provide the parsing info to eval()
Hello, It seems that the parsing information attached to expressions parsed by the parse() function when keep.source=TRUE is not provided to the eval() function. Please consider this code: path <- tempfile() code <- '(function() print( str( sys.calls() ) ))()' writeLines(code, path) sys.source(path, envir=globalenv(), keep.source=TRUE) > OUTPUT: Dotted pair list of 4 $ :