Displaying 20 results from an estimated 20000 matches similar to: "Bug or failing understanding?"
2013 Jan 29
3
how to suppress the intercept in an lm()-like formula method?
I'm trying to write a formula method for canonical correlation analysis,
that could be called similarly to lm() for
a multivariate response:
cancor(cbind(y1,y2,y3) ~ x1+x2+x3+x4, data=, ...)
or perhaps more naturally,
cancor(cbind(y1,y2,y3) ~ cbind(x1,x2,x3,x4), data=, ...)
I've adapted the code from lm() to my case, but in this situation, it
doesn't make sense to
include an
2009 Nov 27
1
my failing understanding ...
The following I do not understand, but then I did'nt really use
S4 methods ...
> showMethods(plot)
Function: plot (package graphics)
x="ANY"
x="lmList.confint"
x="merMCMC"
(inherited from: x="ANY")
> plot(x=moda0MCMC)
Error in as.double(y) :
cannot coerce type 'S4' to vector of type 'double'
> class(moda0MCMC)
[1]
2003 Oct 12
6
Rd problems
Hola!
I have the following in a .Rd file:
\eqn{\mbox{coef} = c(\mbox{coef}[1],\ldots, \mbox{coef}[n]) }
{coef = c(coef[1], coef[2], \dots, coef[n])}
However, both arguments come out in the latex file!
Whats happening?
Kjetil Halvorsen
2004 Oct 04
4
Off-Topic: LaTeX package listings
Hola!
I ask here since I learnt from this list that the LaTeX package listings
should be good
for typesetting R code. I encountered one problem:
\begin{lstlisting}
X %*% V
\end{lstlisting}
in the output the * in %*% disappears! same with %/%, etc, the /
disappears.
Any ideas?
Kjetil
--
Kjetil Halvorsen.
Peace is the most effective weapon of mass construction.
--
2010 Aug 05
2
linear model with similar response predictor
Hi,
can somebody tell me why R is not able to calculate a linear model
written in this way?
> lm (seq(1:100)~seq(1:100))
Call:
lm(formula = seq(1:100) ~ seq(1:100))
Coefficients:
(Intercept)
50.5
Warning messages:
1: In model.matrix.default(mt, mf, contrasts) :
the response appeared on the right-hand side and was dropped
2: In model.matrix.default(mt, mf, contrasts) :
problem
2006 Sep 19
2
mgcv in R-2.4.0.alpha
Hola!
I am sending this to the list since emails from me to Simon Wood
has bounced earlier.
I get:
> library(tsDyn)
Loading required package: mgcv
Erro en `parent.env<-`(`*tmp*`, value = NULL) :
use of NULL environment is defunct
Error: package 'mgcv' could not be loaded
> library(mgcv)
Erro en `parent.env<-`(`*tmp*`, value = NULL) :
use of NULL environment
2003 Aug 16
4
unclass
Have I been sleeping in class?
rw1071 from CRAN, windows XP
incidencia is made by a call to tapply
> class(incidencia)
[1] "array"
> incidencia <- unclass(incidencia)
> class(incidencia)
[1] "array"
Kjetil Halvorsen
2004 Sep 17
3
Removing constants from a data frame
Suppose I have
x<-data.frame(v1=1:4, v2=c(2,4,NA,7), v3=rep(1,4),
v4=LETTERS[1:4],v5=rep('Z',4))
or a much larger frame, and I wish to test for and remove the constant
numeric columns.
I made:
is.constant<-function(x){identical(min(x),max(x))}
and
apply(x,2,is.constant) # Works for numerics
x[,-which(apply(x,2,is.constant))]
I'd really like to be able to
2003 Aug 22
2
converting factor to numeric
Hola!
The R FAQ says:
7.12 How do I convert factors to numeric?
It may happen that when reading numeric data into R (usually, when
reading in a file), they come in as factors. If f is such a factor
object, you can use
as.numeric(as.character(f))
to get the numbers back. More efficient, but harder to remember, is
as.numeric(levels(f))[as.integer(f)]
In any case, do not call as.numeric()
2005 Mar 22
3
mixtures as outcome variables
Dear R-users,
I have an outcome variable and I'm unsure about how to treat it. Any
advice?
I have spending data for each county in the state of California (N=58).
Each county has been allocated money to spend on any one of the
following four categories: A, B, C, and D.
Each county may spend the money in any way they see fit. This also means
that the county need not spend all the money that
2003 Oct 15
2
aov and non-categorical variables
It is unclear to me how aov() handles non-categorical
variables.
I mean it works and produces results that I would
expect, but I was under impression that ANOVA is only
defined for categorical variables.
In addition, help(aov) says that it "call to 'lm' for
each stratum", which I presume means that it calls
to lm() for every group of the categorical variable,
however I
2010 Jan 30
3
Competiciín de classificación!!! Fwd: [R] Classification of supernovae - a challenge
Hola!
Este mail llegó a r-help hoy, yo lo mandó también a esta lista. Es
interesante
con competiciones de predicción/clasificación! ¿Alguien que quiere cooperar?
Kjetil
---------- Forwarded message ----------
From: Kjetil Halvorsen <kjetilbrinchmannhalvorsen@gmail.com>
Date: Fri, Jan 29, 2010 at 12:19
Subject: Fwd: [R] Classification of supernovae - a challenge
To: Kjetil Halvorsen
2003 Sep 02
2
identify with image
Hola!
I will want to identify pixels in an image with the mouse, for
so getting the image data from the matrix(es), for use in subsequent
discriminant analysis. But the following bombs R:
(windows XP, rw1071)
> str(baboon)
list()
- attr(*, "size")= int [1:2] 512 512
- attr(*, "cellres")= num [1:2] 1 1
- attr(*, "bbox")= num [1:4] 0 0 512 512
- attr(*,
2003 Sep 27
3
coloring dendrgram in heatmap?
Using the heatmap function in mva, it seems to be hard to use different
colors in the edges leading to different groups of objects, as commonly done
in many heatmaps in the microarray graphics. Any suggestions? Thanks.
max
2005 May 28
3
Incompatibility with VGAM
I just discovered that when the VGAM package (not on CRAN) is loaded,
glm() doesn't work. This is because VGAM defines a family function()
which gets found
by glm() in place of the family function from stats.
Then VGAM:::family returns an object which doesn't have a $family
component, (it has a component
$vfamily).
I thought namespaces should protect us from this happening?
Kjetil
--
2017 Aug 03
2
rnorm is not truly random used in the lm function
To whom it may concern,
I happened to run the following R code just to check the layout of the
output, but found that the code doesn't work the way I thought it should
work.
''
> lm(rnorm(100) ~ rnorm(100))
Call:
lm(formula = rnorm(100) ~ rnorm(100))
Coefficients:
(Intercept)
-0.07966
Warning messages:
1: In model.matrix.default(mt, mf, contrasts) :
the response appeared
2001 Dec 07
2
error in parse
I am trying to source a file defining a dataset, giving the full path.
(rw1031 on windows 98)
> source("c:\\kjetil\\audiometria\\data\\audiometria.R")
Error in parse(file, n, text, prompt) : syntax error on line 6
also:
> parse(file="c:\\kjetil\\audiometria\\data\\audiometria.R", n=-1)
Error in parse(file, n, text, prompt) : syntax error on line 6
This seems very
2004 Jul 12
3
Smooth monotone estimation on R
Hi all,
I'm looking for smooth monotone estimation packages, preferably using splines.
I downloaded the 'cobs' package and intend to use it, but since it offers only quadratic splines based on L1 minimization, I'd like to compare its performance to that of a more 'mainstream' cubic-spline, L2-norm minimizing spline. Preferably a smoothing spline.
Does anyone know of such
2004 Dec 08
2
Strange error from R CMD INSTALL
I am trying to install a local package and get this unexpected
error:
---------- Making package UMSA ------------
adding build stamp to DESCRIPTION
installing R files
installing data files
installing man source files
installing indices
Error: couldn't find function "na.omit"
Execution halted
na.omit of course is in package stats, and that is listed in the
Depends field in
2004 Nov 06
3
foreign(read.spss) in rw2000 and re2001beta
I encountered something strange with read.spss (package foreign, version
0.7 with R2.0.0 and
version 0.8 with R2.0.1 beta, windows XP)
I made a test file test.sav with SPSS version 11.5.1
containing only one numeric variable, with a value label
for one value not occuring in the file. According to ?read.spss
this should result in a factor, but it results in all NA. Using the
argument