Displaying 20 results from an estimated 9000 matches similar to: "Help file doesn't display correctly"
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}}')),
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
2009 Nov 15
3
Error running lda example from Help File (MASS library )
Hello all,
I'm trying to run lda() from the MASS library but the Help example generates
the
following error:
#Code from example in lda Help file
# Resulting Error
>Error in if (targetlist[i] == stringname) { : argument is of length zero
My Current R Installation:
MacOSX: 10.5.8
R: 2.10.0
--
Gregory Riddick, PhD.
CRTA Research Fellow
National Institutes of Health
National
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
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
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]
2008 May 14
2
basename/dirname produce incorrect results
The incorrect result incurs when the file path contains Chinese character.
It seems that dirname/basename action on unit of byte instead of char, so
the result in the following example is half of what is expected.
> g<-"d:\\$BG!2L4^M-CfJ8(B\\$BG!2L4^M-CfJ8(B.txt"
> dirname(g)
[1] "d:/$BG!2L4^(B"
> basename(g)
[1] "$BG!2L4^M-(B"
--
HUANG Ronggui,
2011 Nov 14
1
.jinit() : Cannot create Java virtual machine
Dear all,
when using .jinit() I get the message .jinit() : Cannot create Java
virtual machine (-1).
The details:
I am using the Dismo package.Dismo has a function 'maxent' that communi-cates with this program(MaxEnt).MaxEnt is available as a stand-alone Java program.
It is normal when I execute the command : "jar <- paste(system.file(package="dismo"),
2008 Oct 28
2
A question about the API mkchar()
Hi guys,
I've got a question about the API mkchar(). I have met some difficulty
in parsing utf-8 string to mkchar() in R-2.7.0.
I was intending to parse an utf-8 string str_jan (some Japanese
characters such as?, whose utf-8 code is E381B5) to R API SEXP
mkChar(const char *name) , we only need to create the SEXP using the
string that we parsed.
Unfortunately, I found when parsing the
2009 Sep 12
2
could not find function "Varcov" after upgrade of R?
After upgrading R to 2.9.2, I can't use the anova() fuction.
It says "could not find function "Varcov" ".
What's wrong with my computer? Help needed, thanks!
Yao Zhu
Department of Urology
Fudan University Shanghai Cancer Center
No. 270 Dongan Road, Shanghai, China
[[alternative HTML version deleted]]
2012 May 31
1
possible bug in "R Editor"
Dear all,
I clicked "File-New Script" to open a R Editor, typed some commands in
it and then saved it to a file. If the location where I tried to save
the script contained Chinese Character, R Editor complained,
Error: invalid input 'E:\Some.Chinese.Characters\new_file.R' in 'utf8towcs'
> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: i386-pc-mingw32/i386
2011 Sep 29
1
Warning: changing locked binding for ...
Dear all, I use the R R Under development (unstable) (2011-09-28 r57099).
When I load the RQDA package, it issues warnings. As the RQDA package
developer, what should I deal with such message? Thank you very much.
> library(gWidgetsRGtk2)
Loading required package: gWidgets
> library(RQDA)
Loading required package: DBI
Loading required package: RSQLite
Use 'RQDA()' to start the
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 04
1
Modify base R functions in Rprofile.site
Hi everyone,
I want to modify two base R functions 'parse' and 'deparse'
immediately after R has started, so I added some code in the file
'Rprofile.site' under the 'etc' directory. Here is a simple example:
parse=function(...){
base::parse(...)
}
I'll get an error when I start R as follows:
Error: cannot change value of locked binding for
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",
2012 Oct 06
3
vector is not assigned correctly in for loop
Hi there,
Here is a minimum working example:
----------------------------------------------------------------
lower = 0
upper = 1
n_bins = 50
interval = (upper - lower) / n_bins
bins = vector(mode="numeric", length=n_bins)
breaks = seq(from=lower + interval, to=upper, by=interval)
for(idx in breaks)
{
bins[idx / interval] = idx
}
print(bins)
2010 Oct 08
4
Bug in as.POSIXct regarding AM/PM
Dear All,
I encounted in a problem with as.POSIXct() function.
> as.POSIXct("2009/03/26 01:00:00 AM" , format="%Y/%m/%d %I:%M:%S %p")
[1] NA
> as.POSIXct("2009/03/26 02:00:00 PM" , format="%Y/%m/%d %I:%M:%S %p")
[1] NA
I have tried this in the R version 2.11.1, R version 2.10.1 and R version
2.9.2 . They all does not work. The operation system is
2008 Dec 31
1
Chinese characters encoding problem with XML
XML is a good tool reading data from web within R. But I wonder how could get the encoding correctly.
library(XML)
url <- 'http://www.szitic.com/docc/jz-lmzq.html'
xml <- htmlTreeParse(url, useInternal=TRUE)
q <- "//tbody/tr/td"
dat <- unlist(xpathApply(xml, q, xmlValue))
df <- as.data.frame(t(matrix(dat, 4)))
dt<-as.character(df[15,1])
The first column of df
2012 Aug 14
2
A drawing problem with R
Dear R-help mailing list,
I have a drawing problem with R:
I need to draw an horizontal axis with date, here is the test code:
> ticks <- c("2004-01-22","2005-01-22","2006-01-22","2007-01-
22","2008-01-22","2009-01-22","2010-01-22","2011-01-22","2012-01-22")
> ats <-