Displaying 20 results from an estimated 2000 matches similar to: "Special characters in Rd example section will cause errors"
2009 Sep 08
1
make check fails in r49613
Hi,
I am reporting what seems to be a trivial error in one of the test
files (this has been failing for a few days for me):
Collecting examples for package 'tools'
Running examples in package 'tools'
Error: testing 'tools' failed
Execution halted
gmake[3]: *** [test-Examples-Base] Error 1
gmake[3]: Leaving directory `/usr/local/share/R-devel/tests/Examples'
gmake[2]:
2011 Oct 17
1
What does \Sexpr[results=rd]{} exactly mean in Rd?
Hi,
I have spent a few hours on the R-exts manual and the documentation of
parse_Rd() (as well as the PDF document in the references), but I
still have not figured out what results=rd means. I thought I could
use an R code fragment to create an Rd fragment dynamically. Here is
an example, in which I was expected the output to be a describe list
<DL> in HTML, but it turns out not to be true.
2011 Jul 12
2
foreach not recognizing functions in memory
All,
I am not understanding the scoping used in foreach when it is used
inside a function. I keep getting "could not find function" errors for
functions that are in memory when I try to use foreach within a function
call. I have a simple example below. "testFun" is in memory and works
when called by foreach directly, but when I place foreach in a function
called
2012 Oct 07
3
get: problem with environments
Dear R users,
I am running R-2.15.1 in Linux Slackware64-14.0. Here is my minimal working example:
testfun <- function (x) {
a <- 0;
sapply(X="a", FUN=get, envir=sys.frame(which=x));
}
Inside R, that is R called from within a Linux terminal, the following code works:
testfun(x=5)
print(testfun(x=6))
But within rkward the above code fails and the following works:
testfun(x=1)
2012 Aug 08
1
random number generator with SNOW/ Parallel/ foreach
Dear All,
I have three classes of questions about generating random numbers with
different packages (windows xp 32bit R).
.
1. Suppose I would like to use package *foreach*, can I use current
Sys.time as a seed?
Although I can get the time up to1e-6 second precesion, the code below dose
not work well on a local machine with two cores. #################
library(foreach)
library(snow)
2015 Feb 18
4
Different serialization of functions in interactive vs. batch mode
Hi Luke,
Ah - I see - thank you! This at least points me to a way on how to
"fix" this. I tried setting the srcref attribute to NULL, but the hash
value is still different and so is the serialization. So this looks
like it is one difference, but not all of them
Even if all differences were identified - it still leaves me with
different behavior between interactive and batch-mode,
2006 Dec 20
4
R windows crash (PR#9426)
Full_Name: Robert Denham
Version: R-2.4.1
OS: Windows Xp
Submission from: (NULL) (61.88.57.1)
R gui exits without warning when I run a function which has an argument with a
default that is not found.
This was a result of an error in a function I wrote, but I thought that it
should exit more gracefully than it does. Here is an example:
testfun <- function(aa=aa) {
aa <-
2017 Oct 04
1
R CMD Rd2pdf and macros
No, I do not get the same as you.
I have tested with R-devel and R-patched compiled today. When I do
R CMD Rd2pdf mpra
I get (as reported a few days ago)
Hmm ... looks like a package
Converting Rd files to LaTeX Error : mpra/man/mpra-package.Rd:6: file
'./DESCRIPTION' does not exist
whereas you (Kurt) reports that this works on zTree.
When I do
R CMD Rd2pdf mpra/man
I get
- a
2017 Oct 03
2
R CMD Rd2pdf and macros
When I run R CMD Rd2pdf on the man pages of a package, ie
R CMD Rd2pdf man
I get
Converting Rd files to LaTeX Warning in parse_Rd("man/mpra-package.Rd",
encoding = "unknown", fragment = FALSE, :
man/mpra-package.Rd:6: unknown macro '\packageTitle'
Warning in parse_Rd("man/mpra-package.Rd", encoding = "unknown", fragment =
FALSE, :
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
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
2015 Feb 18
2
Different serialization of functions in interactive vs. batch mode
Hi,
I posted this question to the regular help list, but it seems to be
this is probably a question that is better addressed on r-devel. Sorry
for the double posting.
I am using hash-values to cache certain results in R. This caching
also depends on the hash-value of the function that is being cached
(calculated using the digest package). I noticed that computations
that should already be cached
2011 Apr 12
2
parse_Rd raises error when example section contains a quoted percent character
I was writing Rd documentation for a new package when I came across
this issue. Here's the smallest example:
> library(tools)
> cat("\\examples{x <- '<%=rnorm(1)%>'}\n",file=file.path(tempdir(),'test.Rd'))
> readLines(file.path(tempdir(),'test.Rd'))
[1] "\\examples{x <- '<%=rnorm(1)%>'}"
>
2013 Jan 14
2
The three-dot question
Dear all,
Why does not the three-dot accept arguments from the parent environment?
I am just confused with this error, can someone give me a hint?
> rm(list=ls())
> testFun <- function(a, ...)
+ {
+ if(a){
+ print(a)
+ }else
+ {
+ print(b)
+ }
+ }
>
> myTask <- function(a)
+ {
+ b <- 3
+ testFun(a, b = b)
+ }
>
2015 Feb 18
1
Different serialization of functions in interactive vs. batch mode
Hi Gabriel,
thanks for your reply - it does solve the problem of my toy function,
but does come with some other problems though.
a) as.list(f)[[1]] yields an expression, not a function. In order to
go the route you are suggesting, I would more likely use "deparse" in
order to get the original back
b) and more seriously - as.list strips the environment of the function
(and thus
2012 Jun 09
1
Applying a function to a column of a data frame
Apologees the novice question. Currently climbing up the learning curve of R.
Suppose I have the following function and the data.frame:
testfun<-function(x=1,y=2) x+y
testframe=data.frame(col1=c(1,2),col2=c(3,4))
When evaluating testfun, I want to use the default value for y (which
is 2) and for x, I want to feed (one by one) the values in col2 of
testframe. How can I achieve this please?
2009 Sep 16
3
apply function across two variables by mult factors
Greetings,
I am attempting to run a function, which produces a vector and
requires two input variables, across two nested factor levels. I can
do this using by(X, list(factor1, factor2), function), however I
haven't found a simple way to extract the list output into an
organized vector form. I can do this using nested loops but it isn't
exactly an optimal approach.
Thank you
2012 Nov 04
1
Rd2pdf freeze
Hi everyone,
>From the currently available version of the package VBmix, I would like to
retrieve the intermediate .tex file that generates the VBmix-manual.pdf
file.
Formerly, running R CMD check with --no-clean allowed to get this tex
source from a hidden directory : this feature was removed, but can
apparently still be accessed through R CMD Rd2pdf --no-clean.
Surprisingly, while the
2023 Jul 21
1
tools::parseLatex() crashes on "\\verb{}"
Do I understand correctly that we don't want Rd files to be valid latex ?
This seems odd to me.
I see that `tools::parse_Rd()` doesn't like `\verb!foo!` so maybe roxygen2
is actually doing the right thing (as opposed to just trying to) ?
`parse_Rd() ` is probably what I need indeed, for some reason I hadn't
found it, so that should fix my own issue here thanks a lot.
Le ven. 21 juil.
2005 Aug 17
4
accesing slots of S4 class in C code
I am trying to use a custom S4 object in my C code and I cannot get the
access to its slots working.
The following is a toy example, but even this crashes.
In R I have:
setClass("pd", representation(data="numeric"))
x <- new("pd", data=1:5)
test <- function(pd.obj) {
res <- .C("TestFun", pd.obj)
res}
test(x)
(Of couse