Displaying 20 results from an estimated 4000 matches similar to: "Modify base R functions in Rprofile.site"
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}}')),
2009 Mar 23
2
How to get commands history as a character vector instead of displaying them?
Hi Everyone,
I want to get the commands history as a character vector instead of
just displaying them, but the function history() just returns NULL. I
checked the source code of 'history' and could not find a solution.
Anybody has an idea? Thanks!
P. S. My original problem is, when a user opens a graphics device like
png() or pdf(), I want to know the file name used by this device. I
2006 May 09
1
A question about encoding
I use R 2.3.0 under windows.
> Sys.getlocale()
[1] "LC_COLLATE=Chinese_People's Republic of
China.936;LC_CTYPE=Chinese_People's Republic of
China.936;LC_MONETARY=Chinese_People's Republic of
China.936;LC_NUMERIC=C;LC_TIME=Chinese_People's Republic of China.936"
> localeToCharset()
[1] "CP936"
Now I want to use JGR,which uses UTF-8 encoding.
So when I use
2005 Apr 19
3
error due to locales again
>example(lm)
Error in switch(x[2], "1250" = return("ISO 8859-2"), "1251" = return("KOI8-U"), :
argument is missing, with no default
> Sys.getlocale(category = "LC_ALL")
[1] "LC_COLLATE=Chinese_People's Republic of China.936;LC_CTYPE=Chinese_People's Republic of China.936;LC_MONETARY=Chinese_People's Republic of
2011 Nov 14
1
Error .jcall(mxe, "S", "fit", c("autorun", "-e", afn, "-o", dirout, : java.lang.NoSuchMethodError: density.Params.readFromArgs([Ljava/lang/String; )Ljava/lang/String;
Dear all,
I get the error when I use maxent.jar:
Error .jcall(mxe, "S", "fit", c("autorun", "-e", afn, "-o", dirout, :
java.lang.NoSuchMethodError: density.Params.readFromArgs([Ljava/lang/String;)Ljava/lang/String;
sessionInfo() result:
R version 2.14.0 (2011-10-31)Platform: i386-pc-mingw32/i386 (32-bit)locale:[1]
2011 Apr 21
0
automatic font selection, please help
Hi there,
With the helps from this list, I can set specific CJK fonts for
character string using text() function. for example:
song <- CIDFont("SimSun", "GBK-EUC-H", "GBK", "")
postscriptFonts(song = song)
postscript("test.ps", height = 7, width =7, family = "Times", fonts =
c("song"), horizontal = FALSE, onefile =
2005 Apr 21
0
error reports
Dear John Fox,
these is still error in Rcmdr package when locale is cp936.
> Loading required package: tcltk
> Loading Tcl/Tk interface ... done
> Error in parse(file, n, text, prompt) : syntax error on line 5090
> Error: unable to load R code in package 'Rcmdr'
> Error: package/namespace load failed for 'Rcmdr'
> version
_
platform
2009 Oct 06
2
Help file doesn't display correctly
Dear R Developer,
It seems to be a problem with help file. Not sure if it is related to
the new format of Rd parser. Multiple lines are joined together
without proper line break.
> ?mean
There were 14 warnings (use warnings() to see them)
## All lines are joined together and not easy to read.
> warnings()
Warning messages:
1: In grepl("^[[:blank:]]*$", buffer[length(buffer)]) :
2010 Nov 25
0
[libsvm] predict function error
Dear R users,
There is a error message when I run the following code. It is used to load
microarray data and use the top 1000 genes for training svm to classify test
set .
> library(e1071)
Loading required package: class
> f=read.table("F:\\lab\\
microarray analysis\\VEH LPS\\exprs.txt",
2009 Jan 23
1
overwriting '<-' and infinite recursions
Hello all,
I'm having a problem when overwriting the '<-' function and was told
I'd better post it here for help. The reason why I need to overwrite
it is complicated and not easy to tell in a few words; but this seems
the only clean option other than hacking R's core source code. My code
looks like:
# in .onLoad of a package; or if you want to test, put it in a function
2008 Mar 13
3
Sealed for setGeneric
Hi the list
When two setGeneric occurs on the same function, the second erage the
first and erase all the function previously define.
Is it possible to prevent that ? Is it possible to declare a setGeneric
that can not be erased later ?
Something like the |sealed for setMethod...|
||
|Thanks|
||
Christophe
2018 Dec 21
2
Bug report: R.home() cause package Rcpp failed executing sourceCpp, similar bug are labeled "BUG 16660" since 2016 and here I could provide a solution that tested in my laptop.
https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16660
Here is the bug, which R.home may generate a path contains a whitespace.
this will cause Rcpp failed executing sourceCpp
> sourceCpp("b:/2018-12-14/src/18020/MCMC.cpp")
Error in system(cmd, intern = !showOutput) : 'D:/Program' not found
Error in system(cmd, ignore.stderr = TRUE, intern = TRUE) :
2011 Jan 26
1
Problem with "setMethod" in R package
Dear all,
My apologies for re-posting this question, but I have not found any
solution to my problem so far. I also think that my post may have been
overseen due to the posting time and high traffic on this list.
I experience a problem in implementing a S4 class in a package and would
appreciate your help in this matter.
The class is implemented using Rcpp, which works well. I then extend
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
2024 Mar 21
1
[External] Re: Building Packages. (fwd)
[forgot to copy to R-help so re-sending]
---------- Forwarded message ----------
Date: Thu, 21 Mar 2024 11:41:52 +0000
From: luke-tierney at uiowa.edu
To: Duncan Murdoch <murdoch.duncan at gmail.com>
Subject: Re: [External] Re: [R] Building Packages.
At least on my installed version (which tells me it is out of date)
they appear to just be modifying the "package:utils" parent
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))
2024 Mar 21
1
[External] Re: Building Packages. (fwd)
If you are wondering why RStudio did this, you can see their substitute
function using
(parent.env(environment(install.packages)))$hook
They appear to do these things:
- Allow package installation to be disabled.
- Check if a package to be installed is already loaded, so that
RStudio can restart R for the install.
- Add Rtools to the PATH if necessary.
- Trigger an event to say
2010 Mar 11
1
parse an HTML page with verbose error message (using XML)
I'm using the function htmlParse() in the XML package, and I need a
little bit help on error handling while parsing an HTML page. So far I
can use either the default way:
# error = xmlErrorCumulator(), by default
library(XML)
doc = htmlParse("http://www.public.iastate.edu/~pdixon/stat500/")
# the error message is:
# htmlParseStartTag: invalid element name
or the tryCatch()
2010 Apr 13
1
formatR: farewell to ugly R code
This is an announcement of the release of an R package 'formatR',
which can help us format our R code to make it more human-readable. If
you have ugly (I mean unformatted) R code like this:
?# rotation of the word "Animation"
# in a loop; change the angle and color
# step by step
for (i in 1:360) {
? # redraw the plot again and again
2010 Apr 13
1
formatR: farewell to ugly R code
This is an announcement of the release of an R package 'formatR',
which can help us format our R code to make it more human-readable. If
you have ugly (I mean unformatted) R code like this:
?# rotation of the word "Animation"
# in a loop; change the angle and color
# step by step
for (i in 1:360) {
? # redraw the plot again and again