Displaying 20 results from an estimated 5000 matches similar to: "Replies for Importing Excel File"
2004 Jul 07
7
Importing an Excel file
Hello, R users,
I am a very beginner of R and tried read.csv to import an excel file after
saving an excel file as csv. But it added alternating rows of fictitious NA
values after row number 16. When I applied read.delim, there were trailing
several commas at the end of each row after row number 16 instead of NA
values. Appreciate your help.
Kyong
[[alternative HTML version deleted]]
2007 May 20
0
optional fields in function declarations; Solved
thank you to both Adaikalavan and Patrick.
on the basis of Adaikalavan example this is an example that point out my problems.
>log_raise=function(num, exp, base){return(log(num^exp,base))}
I would like to have optional fields, so some settings to be default parameters;
if I declare the function as above the operator must of course input all the variables.
Finally I could fix as follow.
2004 Jul 16
0
Does AIC() applied to a nls() object use the correctnumber of estimated parameters?
Thanks Adaikalavan, however the problem remains.
Considering AIC() as applied to the linear model in AIC() help
documentation:
> data(swiss)
> lm1 <- lm(Fertility ~ . , data = swiss)
> AIC(lm1)
[1] 326.0716
Clearly this includes the estimation of the residual standard error as
an estimated parameter, as this gives the correct score:
> -2*logLik(lm1) + 2*(length(coef(lm1))+1)
2004 Mar 15
2
make check on Solaris 8 fails due to plot
Dear all,
I am having trouble trying to install R-1.8.1 on a Sun Solaris 8
(Generic_108528-23 version) machine. The configuration was successful but
make check fails. I traced the the problem to the plot() function.
> 1 + 1
[1] 2
> capabilities()
jpeg png tcltk X11 GNOME libz http/ftp sockets
TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE
2004 Sep 06
4
substitution in expression
I have been struggling with this problem for a while and I hope someone
could help me. Or if someone could point me to a section in the manual I
would be grateful.
x <- "my"
plot(1:10, main=expression(paste( x, Delta, "values" )))
Q : How do I get the title to say "my (triangle symbol) values" ?
The following trial-and-error produced mainly errors :
2004 Nov 04
0
(no subject)-about the waring/errors in ks.test
[In future, please press reply all as there might be others in the
mailing list who can help you]
Without a (short) reproducible example, it would be difficult to say.
BTW, I think you have mistyped the error/warning message. Does it
actually say "cannot compute _correct_ p-value" or "cannot compute
_exact_ p-value". See example below.
> wilcox.test( 1:3, 1:10 )
2004 Oct 01
3
same test statistic for t-test with and without equal variance assumption
Could some kindly tell me if I am supposed to be getting the same test
statistic value with var.equal=TRUE and var.equal=FALSE in t.test ?
set.seed(1066)
x1 <- rnorm(50)
x2 <- rnorm(50)
t.test(x1, x2, var.equal=FALSE)$statistic # 0.5989774
t.test(x1, x2, var.equal=TRUE)$statistic # 0.5989774 ???
Here are my own calculations that shows that perhaps the result when
var.equal=TRUE is
2002 Jul 15
2
meaning of error message about collinearity
You are using a method that needs to estimate the covariance matrix of all
the variables. If you have 80 variables, there are (80+1)*80/2 = 3240
variances and covariances to estimate. How many data points do you think
you need to do that?
Some people assume the covariance matrix is diagonal (i.e., assuming all the
variables are uncorrelated). Even then you still have 80 variances to
estimate.
2002 Aug 12
0
Attaching marginal summary plots to the main matrix plot
Take a look at the manual page for "layout". The final example does pretty
much what you're asking about (with a scatterplot and histograms, but the
idea should be the same).
Hope this helps,
Matthew Wiener
Applied Computer Science & Mathematics Dept.
Merck Research Labs
Rahway, NJ 07090
732-594-5303
-----Original Message-----
From: Adaikalavan Ramasamy [mailto:ramasamy at
2006 Jun 20
0
inplace assignment: solution
I worked this out over the weekend. I appreciate that using temporary
variables would be simpler but I think this makes for quite readable
code:
# in RProfile.site
inplace <- function (f, arg=1)
eval.parent(call("<-",substitute(f)[[arg+1]], f),2)
# examples in code
inplace(foo[bar,baz] *2)
# or
inplace(paste(foo[bar,baz], 1:10))
# or
inplace(sub("blah",
2004 Jul 30
2
pairwise difference operator
There was a BioConductor thread today where the poster wanted to find
pairwise difference between columns of a matrix. I suggested the slow
solution below, hoping that someone might suggest a faster and/or more
elegant solution, but no other response.
I tried unsuccessfully with the apply() family. Searching the mailing
list was not very fruitful either. The closest I got to was a cryptic
chunk
2005 Jul 25
5
passing formula arguments cv.glm
I am trying to write a wrapper for the last example in help(cv.glm) that
deals with leave-one-out-cross-validation (LOOCV) for a logistic model.
This wrapper will be used as part of a bigger program.
Here is my wrapper funtion :
logistic.LOOCV.err <- function( formu=NULL, data=NULL ){
cost.fn <- function(cl, pred) mean( abs(cl-pred) > 0.5 )
glmfit <- glm(
2003 Apr 24
1
Invalid font in bitmap()
Dear all,
A few weeks ago I asked about X11() availability using CGI-perl. The
general advice was to use bitmap which requires ghostscript (Xvnc and
Xvbf were the other alternatives). My system administrator got around to
installing Aladin Ghostscript 6.0 and the setting the R_GSCMD
environment variable. Other system specification is given below.
But now I have a new problem that says that font
2002 Jul 26
0
Parzen Windows
I suspect Prof. Ripley's response suffices. However, there *is* a Parzen
kernel for kernel smoothing:
Parzen K(z) = { 4/3 - 8z^2 + 8|z|^3 if |z| <= 1/2
8(1 -|z|)^3/3 if 1/2 < |z| <= 1
0 otherwise
If I'm not mistaken, this appeared in Parzen's original 1962 paper on kernel
density estimation. I also seem to recall
2005 Jun 10
1
Abrupt shut down of R session
Dear R users,
I'm using R 2.1.0 with Windows 2000. In the middle of a R session, an error
message pops up saying Rgui.exe generated errors and shuts down the R
session. How can I correct this problem? Appreciate your help.
Kyong
[[alternative HTML version deleted]]
2007 Dec 27
1
A function for random test based on longest run (UNCLASSI FIED)
Classification: UNCLASSIFIED
Caveats: NONE
Thanks for your quick response. The program you mentioned below available
from R is based on number of runs (up or down) not based on a longest length
of runs of same events. To be more specific, for example, from a series,
HHTHTTTTHHH, the number of runs are 5, and the longest length of runs of the
same events is 4. I'll check for the website you
2004 Aug 17
2
Re: Thanks Frank, setting graph parameters, and why social scientists don't use R
First, many thanks to Frank Harrell for once again helping me out. This actually relates to the next point, which is my contribution to the 'why don't social scientists use R' discussion. I am a hybrid social scientist(child psychiatrist) who trained on SPSS. Many of my difficulties in coming to terms with R have been to do with trying to apply the logic underlying SPSS, with dire
2008 Mar 17
0
Summary Regard with Lme does not work without a random effect (UN CLASSIFIED)
Classification: UNCLASSIFIED
Caveats: NONE
R users,
This is a summary for the responses I got from Sandra Dorai-Raj and Simon
Blomberg followed by my question.
Sandra suggested using lm instead of lme for a model without a random
effect, and Simon suggested anova.lme instead of anova.lm for comparing two
models with and without a random effect. For the anova test, both anova.lme
and anova
2007 May 18
1
penalized maximum likelihood estimator
dear R-helper,
I tried to find out a package in which i can have
penalized maximum likelihood estimator applying on
generalized extreme value distribution with beta
function) but could not. would you please help me to
know the name of the package. thanks for your help.
S.Murshed
--- r-help-request at stat.math.ethz.ch wrote:
> Send R-help mailing list submissions to
> r-help at
2005 Jun 10
0
Replies of the question about robustness of segmented regression
I appreciate to Roger Koenker, Achim Zeileis and Vito Muggeo for their
informative answers. Listed below is unedited replies I got followed by the
question I posted.
Kyong
1. Roger Koenker:
You might try rqss() in the quantreg package. It gives piecewise
linear fits
for a nonparametric form of median regression using total variation
of the
derivative of the fitted function as a penalty