Displaying 20 results from an estimated 10000 matches similar to: "Why cannot `Rscript -e` accept an empty line?"
2011 May 03
4
Wishlist: write R's bin path to the PATH variable and remove the version string in the installation dir under Windows
Hi,
I guess this issue must have been brought forward long time ago, but I
still hope you can consider under Windows (during installation):
1. put R's bin path in the PATH variable of the system so that we can
use the commands "R" and "Rscript" more easily;
2. remove the version string like R-2.13.0 in the default installation
directory, e.g. only use a directory like
2010 Sep 18
1
Check for updates under Windows (Was: a reliable way to check the latest version of R on CRAN?)
Dear R developers,
I asked this question in r-help list but have not got a definite
solution yet, and I think it might be more appropriate to ask
developers or CRAN maintainers directly. Many software packages often
have a menu item like "Check for updates" under the "Help" menu, e.g.
Filezilla and Firefox, and I believe it is also necessary for R (at
least for R GUI under
2011 Mar 05
1
file mode lost in file.copy()?
Hi,
Recently I noticed file.copy() would discard the file mode
information. Is this the expected behaviour or a bug for file.copy()?
> file.create('testfile')
[1] TRUE
> file.info('testfile')
size isdir mode mtime ctime
testfile 0 FALSE 644 2011-03-05 17:06:39 2011-03-05 17:06:39
atime uid gid uname grname
2011 Mar 05
1
file mode lost in file.copy()?
Hi,
Recently I noticed file.copy() would discard the file mode
information. Is this the expected behaviour or a bug for file.copy()?
> file.create('testfile')
[1] TRUE
> file.info('testfile')
size isdir mode mtime ctime
testfile 0 FALSE 644 2011-03-05 17:06:39 2011-03-05 17:06:39
atime uid gid uname grname
2013 Jan 04
1
Bug in R CMD check for \ in Rd?
Hi,
I have a function knit_expand() and its source/Rd are below:
https://github.com/yihui/knitr/blob/master/R/template.R#L43-L44
https://github.com/yihui/knitr/blob/master/man/knit_expand.Rd
When I run R CMD check on the package I get this warning (with both R
2.15.2 and R-devel):
* checking for code/documentation mismatches ... WARNING
Codoc mismatches from documentation object
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)?
>
2013 Apr 08
2
savePlot() under Windows
Hi,
A Windows user asked me a question and I believe this is a bug of R
3.0.0 under Windows:
> plot(1:10)
> savePlot('test.wmf')
Error in .External(C_savePlot, device, filename, type, restoreConsole) :
Incorrect number of arguments (4), expecting 3 for 'savePlot'
> sessionInfo()
R version 3.0.0 (2013-04-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1]
2010 Nov 25
3
Go (back) from Rd to roxygen
Hi all,
Since roxygen is a great help to document R packages, I am wondering
if there exists an approach to go back from the raw Rd files to
roxygen-documentation? E.g. turn "\author{Somebody}" into "@author
Somebody". This sounds ridiculous, but I believe it helps in the long
term for me to maintain R packages.
Thanks!
Regards,
Yihui
--
Yihui Xie <xieyihui at
2011 Apr 10
1
deparse operators in expressions
Hi,
I observed a slight problem in deparse(): it will add spaces around
most operators except /. I wonder if this is easy to fix. I know this
is quite trivial, but I will appreciate if / is not treated as an
exception. Examples:
> deparse(expression(1/1))
[1] "expression(1/1)"
> deparse(expression(1+1))
[1] "expression(1 + 1)"
> deparse(expression(1%in%1))
[1]
2011 Jun 20
1
Quote the path of graphics output in Sweave when it contains spaces
Hi,
I'm aware of the definition of a "valid filename" in
.SweaveValidFilenameRegexp, but I think it might be better to quote
the filename when it contains spaces instead of just giving a warning.
This should bring us safer LaTeX code (although I never use spaces in
paths).
Here is the simple patch:
Index: src/library/utils/R/SweaveDrivers.R
2012 May 22
2
how to remove the 'promise' attribute of an R object (.Random.seed)?
Hi,
The problem arises when I lazyLoad() the .Random.seed from a
previously saved database. To simplify the process of reproducing the
problem, see the example below:
## this assignment may not really make sense, but illustrates the problem
delayedAssign('.Random.seed', 1L)
typeof(.Random.seed)
# [1] "integer"
rnorm(1)
# Error in rnorm(1) :
# .Random.seed is not an integer
2012 May 22
2
how to remove the 'promise' attribute of an R object (.Random.seed)?
Hi,
The problem arises when I lazyLoad() the .Random.seed from a
previously saved database. To simplify the process of reproducing the
problem, see the example below:
## this assignment may not really make sense, but illustrates the problem
delayedAssign('.Random.seed', 1L)
typeof(.Random.seed)
# [1] "integer"
rnorm(1)
# Error in rnorm(1) :
# .Random.seed is not an integer
2014 Jan 24
1
Format an empty data frame
Hi,
Here seems to be a corner case in which format() fails:
> format(data.frame())
Error in .subset2(x, i, exact = exact) : subscript out of bounds
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
2010 Sep 16
1
a reliable way to check the latest version of R on CRAN?
Hi all,
We know old.packages() can check for updates of add-on packages, but
is there a way to check updates of R itself? "go to R homepage" is a
way, of course, but I hope this can be done by R.
I'm not sure about the "reliable" place to check; here is a simple
example to check from one of the CRAN webpages (kind of nasty
approach...):
x =
2013 Sep 18
1
getParseData() for imaginary numbers
Hi,
The imaginary unit is gone in the 'text' column in the returned data
frame from getParseData(), e.g. in the example below, perhaps the text
should be 1i instead of 1:
> p=parse(text='1i')
> getParseData(p)
line1 col1 line2 col2 id parent token terminal text
1 1 1 1 2 1 2 NUM_CONST TRUE 1
2 1 1 1 2 2 0 expr
2014 Dec 10
2
UTF8 markdown vignette
On 09/12/2014, 10:36 PM, Yihui Xie wrote:
> I took a look at the R source and I realized that the encoding was
> actually never passed to the vignette engine:
> https://github.com/wch/r-source/blob/e721ef5f4/src/library/tools/R/Vignettes.R#L507
> Apparently only the file and quiet arguments are passed to the
> vignette engine. Did I miss anything?
I think it's actually a little
2009 Nov 09
1
deparse() and the 'else' statement
Hi all,
It is recommended in ?'if' that we use 'else' right after '}' instead
of starting a new line, but I noticed deparse() will separate '}' and
'else' when the 'if...else' clause is used inside {...} (e.g. function
body). Here is an example:
## if/else inside {}
> cat(deparse(parse(text='function(){if (TRUE) {1} else {2}}')),
2010 Dec 14
1
redesign R.css for HTML help pages
Hi,
I feel the CSS definitions for the HTML help pages are not visually
appealing enough. I admit this is a very subjective matter, so I don't
have strong arguments for this wishlist, although I wrote my version
of R.css with some web design instructions in mind (e.g. use
browser-safe sans-serif fonts).
Anyway, here is what I've done:
2013 Oct 21
2
png(type='cairo'): point symbols without boarders are not anti-aliased?
Hi,
It seems that anti-aliasing in png(type = 'cairo') is not well
supported for the point symbols without boarders, e.g. pch = 16. The
Cairo package works well, though. You can compare png() with
CairoPNG():
png(): http://i.imgur.com/8niB3jX.png
CairoPNG(): http://i.imgur.com/FZBJOxm.png
f = function(dev, ..., main = '') {
dev(...)
plot(c(1, 2, 1, 2), c(1, 1, 2, 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.