Displaying 20 results from an estimated 11000 matches similar to: "writing character to a file in UTF-8"
2007 May 19
2
What's wrong with my code ?
I try to code the ULS factor analysis descrbied in
ftp://ftp.spss.com/pub/spss/statistics/spss/algorithms/ factor.pdf
# see PP5-6
factanal.fit.uls <- function(cmat, factors, start=NULL, lower = 0.005,
control = NULL, ...)
{
FAfn <- function(Psi, S, q)
{
Sstar <- S - diag(Psi)
E <- eigen(Sstar, symmetric = TRUE, only.values = TRUE)
e <- E$values[-(1:q)]
e <-
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]]
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,
2007 May 27
2
Question about "evalq"
The help page of eval says: The 'evalq' form is equivalent to
'eval(quote(expr), ...)'. But the following is not equivalent. Can
anyone give me some explaination? Thanks very much.
> f1 <- function(x,digits=5) lapply(x, f2)
> f2 <- function(x) eval(quote(print(x+1,digits=digits)),list(x=x),parent.frame(2))
> f1(list(x1=1))
[1] 2
$x1
[1] 2
>
> f1 <-
2007 Jun 15
2
method of rpart when response variable is binary?
Dear all,
I would like to model the relationship between y and x. y is binary
variable, and x is a count variable which may be possion-distribution.
I think it is better to divide x into intervals and change it to a
factor before calling glm(y~x,data=dat,family=binomail).
I try to use rpart. As y is binary, I use "class" method and get the
following result.
>
2008 Jan 21
3
Need suggestions about GUI
What I want to do is:
1, creat a text box, insert text into that box.
2, select chunk of of the text by mouse, and link it to a lable. so I would
like a way to get that chunk of text.
Can I do such job with tcltk? Any relavant tutorial materials?
Thanks
--
HUANG Ronggui
Bachelor of Social Work, Fudan University, China
Master of sociology, Fudan University, China
Ph.D. Student , CityU of
2007 Mar 12
1
Problem with installation of littler-0.0.10. under Free BSD 6.2
MyBSD% ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking build system type... i386-unknown-freebsd6.2
checking host system type... i386-unknown-freebsd6.2
checking for a BSD-compatible install...
2005 Nov 27
2
multilevel models and sample size
It is not a pure R question,but I hope some one can give me advices.
I want to use analysis my data with the multilevel model.The data has 2 levels---- the second level has 52 units and each second level unit has 19-23 units.I think the sample size is quite small,but just now I can't make the sample size much bigger.So I want to ask if I use the multilevel model to analysis the data set,will
2008 Jun 07
1
Problem of installing Matrix
[wincent at PC-BSD]export MAKE=gmake
[wincent at PC-BSD]sudo R
.....
> install.packages("Matrix")
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
trying URL 'http://bibs.snu.ac.kr/R/src/contrib/Matrix_0.999375-9.tar.gz'
Content type 'application/x-gzip' length 1483674 bytes (1.4 Mb)
opened URL
2008 May 12
1
Insert a recorde into a table using SQL
Dear list,
I want to insert a recorde into a SQLite table by dbGetQuery(), but
there is a problem when the value contains quotation mark.
> dd<-data.frame(txt=c("having both ' and \" in character.","OK"))
> library(RSQLite)
Loading required package: DBI
> con<-dbConnect(dbDriver("SQLite"),":memory:")
>
2007 Apr 10
1
When to use quasipoisson instead of poisson family
It seems that MASS suggest to judge on the basis of
sum(residuals(mode,type="pearson"))/df.residual(mode). My question: Is
there any rule of thumb of the cutpoiont value?
The paper "On the Use of Corrections for Overdispersion" suggests
overdispersion exists if the deviance is at least twice the number of
degrees of freedom.
Are there any further hints? Thanks.
--
Ronggui
2012 May 09
2
file path
Dear all, is there any function to assert whether a file path is
legitimate, and to convert any potential file path to a legitimate
file path?
I automate a batch of files and write them to plain text files with
cat(). The file argument of cat() is generated automatically which may
contain characters such as ? < >, unacceptable in Windows OS. What I
do at this moment is to strip such
2011 Apr 26
1
rJava Help
I believe this posting is placed, and I take the liberty to re-direct
to the r-help mailing list.
Regards,
Ronggui
On 26 April 2011 12:33, <gopala at mail.gvsu.edu> wrote:
> ?I am trying to create a web user interface using RApache. I need to install rJava packge but I am getting the following error message
>
> RApache Warning/Error!!!
>
> Error : .onLoad failed in
2005 Oct 15
2
how to import such data to R?
the data file has such structure:
1992 6245 49 . . 20 1
0 0 8.739536 0 . . .
. . . . . "alabama"
. 0 .
1993 7677 58 . . 15 1
0 0
2005 Jul 03
2
demo(scoping)
entercount an error with demo(scoping).
> demo(scoping)
demo(scoping)
---- ~~~~~~~
___snip_____
> ross$balance()
Your balance is 120
> try(ross$withdraw(500))
Error in ross$withdraw(500) : You don't have that much money!
> version
_
platform i486-pc-linux-gnu
arch i486
os linux-gnu
system i486, linux-gnu
status beta
major 2
minor
2007 Jan 19
1
Where can I get the latex format manual?
In www.r-project.org I can find html and pdf format, and the
R-x.x-x/doc/manual has texinfo format only.
I can not find latex format manual. Am I miss something? Thanks for your hints.
--
Ronggui Huang
Department of Sociology
Fudan University, Shanghai, China
??????
????????????????
2005 Oct 23
1
question about technieque do with large computation
The green book tells:"The basic technique is classic :keep it simple ."A long ,complicated expression or function is less fravorable than" a relatively small computations that combines calls to a few other functions to perform its tasks."
But I don't get the point totally.Can anyone give me an example to make me understand this rules totally?
ps:
Is it mean that f1 is
2005 Jun 19
2
what does this syntax mean?
i study the code of function ave,but i can understand one line of the syntax.
> ave
function (x, ..., FUN = mean)
{
n <- length(list(...))
if (n) {
g <- interaction(...)
split(x, g) <- lapply(split(x, g), FUN)
}
else x[] <- FUN(x)
x
}
my question is : what does "split(x, g) <- lapply(split(x, g), FUN)" mean?
thank you!
--
2006 Feb 22
2
does multinomial logistic model from multinom (nnet) has logLik?
I want to get the logLik to calculate McFadden.R2 ,ML.R2 and
Cragg.Uhler.R2, but the value from multinom does not have logLik.So my
quetion is : is logLik meaningful to multinomial logistic model from
multinom?If it does, how can I get it?
Thank you!
ps: I konw VGAM has function to get the multinomial logistic model
with logLik, but I prefer use the function from "official" R
2006 Oct 20
2
how to replace the second "-"
I have a string vector like these:
[1] "1-1-1" "1-1-2" "1-2-1"
And I wanna replace the second "-" with "0", that is, I wanna get the result
like: [1] "1-101" "1-102" "1-201".
How should I write the Regular Expressions? Thanks!
--
»ÆÈÙ¹ó
Department of Sociology
Fudan University
[[alternative HTML version deleted]]