Displaying 20 results from an estimated 1100 matches similar to: "aggregate() example fails]"
2009 Mar 23
0
aggregate() example fails
Hi R users and developers.
I compile the
R version 2.8.1 Patched (2009-03-18 r48193)
On my UBUNTU linux distribution.
But hen I ask for the aggregate example it fails.
What am I missing?
example(aggregate)
aggrgt> ## Compute the averages for the variables in 'state.x77',
grouped
aggrgt> ## according to the region (Northeast, South, North Central,
West) that
aggrgt> ## each
2009 Mar 24
1
Is aggregate() function changing?
Hi R developers and debian users:
Finally I found how to work with aggregate() function
on the last patched version fo R.
I you use this command it fails:
aggregate(state.x77, list(Region = state.region), mean)
But if you modify it in this way, it works!:
aggregate(state.x77, list(Region = state.region), function(x) mean(x) )
Is it necesary to change the example?
What is changing in
2009 Mar 24
1
Is aggregate() function changing?
Hi R developers and debian users:
Finally I found how to work with aggregate() function
on the last patched version fo R.
I you use this command it fails:
aggregate(state.x77, list(Region = state.region), mean)
But if you modify it in this way, it works!:
aggregate(state.x77, list(Region = state.region), function(x) mean(x) )
Is it necesary to change the example?
What is changing in
2011 Mar 09
1
state.x77 dataset
I tried:
> data(state.x77)
Warning message:
In data(state.x77) : data set 'state.x77' not found
data(iris) seems to work fine, but the other state datasets (which I haven’t every tried before) don’t seem to be available
on my windows 7 running R 2.12.2 installation.
?state brings up the state help page page which suggest the dataset should still be there. In help there still seems to
2009 Apr 05
1
problem with lattice tiff or bitmap: character size and color
Hi all,
I am trying to make tiff files of lattice plots at a resolution greater
than 300 dpi required by a journal (PLoS ONE). I have tried both the tiff
and bitmap functions. tiff keeps panel colors but reduces axes and tick
labels so they are nearly invisible. bitmap maintains correct label size
but only produces greyscale. Regular plots work fine with tiff; the
problem is only with lattice
2001 Dec 27
1
scale in stars() is not as documented (PR#1230)
R 1.4.0
?stars has
scale: logical flag: if `TRUE', the columns of the data matrix are
scaled independently so that the maximum value in each column
is 1 and the minimum is 0. If `FALSE', the presumption is
that the data have been scaled by some other algorithm to the
range [0,1].
but the code has
if (scale) {
x <- sweep(x, 2,
2012 Jan 19
1
question re. package playwith not able to run command getting error message that I'm attempting to use non function
Hello, I managed to install playwith package and all its prerequisites. My
R version is R 2.14:
R version 2.14.1 (2011-12-22)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
All my packages were updated, and recently installed. When I attempt
to use the command playwith I get the following error message:
>
2013 Apr 09
4
Converting matrix to data frame without losing an assigned dimname
Hello All,
Would like to be able to convert a matrix to a dataframe without losing an assigned dimname.
Here is an example that should illustrate what I'm talking about.
tableData <- state.x77[c(7, 38, 20, 46), c(7, 1, 8)]
names(dimnames(tableData)) <- c("State", "")
tableData
State Frost Population Area
Connecticut 139 3100 4862
2002 May 17
0
aggregate() classing var. def.
Dear all,
I want to aggregate() my data based of the classes of a factors, just as in the
help file, but how do I define the "Region varable" in the ?aggregate example?
Now, the column is just like any other in my data matrix. As I understand it
from ?(state), state contains a matrix with the columns Pop, Income etc., but
Region is somehow separated. I noted below that as.list() is
2010 May 17
3
Create counter variable for subsets without a loop
Hi all,
I am looking to create a rank variable based on a continuous variable
for subsets of the data. For example, for an R integrated data set
about US states this is how a loop could create what I want:
### Example with loop
data <- cbind(state.region,as.data.frame(state.x77))[,1:2] #
choosing a subset of the data
data <- data[order(data$state.region, 1/data$Population),] #
2014 Feb 26
2
error en ifelse
Hola
No es lo mismo pero en mi caso personal la forma que utilizo se basa en
el ejemplo de http://cran.r-project.org/doc/contrib/grafi3.pdf página
49, no usa el if pero también hay una condición para todos los verdaderos.
No intenté en este caso en particular, habría que ver si también da
problemas, pero como Carlos Ortega que sabe mucho dio una solución y
como vos estas empezando no quiero
2011 Aug 20
2
a Question regarding glm for linear regression
Hello All,
I have a question about glm in R. I would like to fit a model with glm function, I have a vector y (size n) which is my response variable and I have matrix X which is by size (n*f) where f is the number of features or columns. I have about 80 features, and when I fit a model using the following formula,?
glmfit = glm(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 + x12 + x13
2014 Feb 26
2
error en ifelse
El problema puede estar en el no uso de suficientes paréntesis. Por
ejemplo, con:
> a=1
> b=0
> c=0
la instrucción
ifelse(((a>1) | (b=0) | (c=1) | (d=1)), 11, 22)
da el resultado esperado:
[1] 11
Pero si se omiten los paréntesis se llega a un error de interpretación:
destino de la asignación se expande a un objeto fuera del lenguaje
Espero que sirva
Jorge
El 26/2/14, daniel
2008 Sep 21
2
r format questions
Hi,
1) I have noticed that when I use the aggregate function it outputs numbers in the results. for example:
aggregate by product
group.1 Aggregate
1 ProductA 1000400.00
2 ProductB 23232323.00
3 Missing 232323.00
is there a way to suppress the numbers infront of aggregate outputs. I checked and they don't look like columns when I do a summary so I can't -1
2014 Oct 08
2
Problema con los paneles de un grafico
Comunidad superpower, tengo la siguiente pregunta-problema.
Tengo una matriz de datos como la siguiente (adjunto archivos de datos):
sol con dia rep nca nin iso are
1 con 0 1 1 16 0 s 0.3866520976
2 con 0 1 1 16 1 c 0.0008842527
3 con 0 1 1 18 0 s 0.2409465396
4 con 0 1 1 18 1 c 0.0021092822
5 con 0 3 1 16 0 s 0.6005446999
6 con
2015 May 28
2
La ejecución de mi script R es muy lenta
Hola,
Si no tienes inconveniente en compartir tu conjunto de datos (puedes
dejarlo en un Dropbox y compartir enlace) o incluir una salida de la
variables: "seta" y "outcomes" (función "save.image()") con eso podemos
darte alguna solución mucho más rápida que la que planteas.
En tu código con un bucle estás tratando de rellenar una lista que son los
diferentes
2001 Mar 13
1
Display grouping parameter in coplot
I try to display the grouping variable in coplot.
It work, but it's special solution and rather ugly.
Any better idea?
# Simulate my data frame
data(state)
x77<-data.frame(state.x77)
x77$region<-state.region
coplot(Life.Exp ~ Income | region,
data=x77, show.given=F, subscripts=T,
panel = function(x, y,subscripts, ...)
{
panel.smooth(x, y, span = 1., ...)
2008 Jan 12
2
Lattice equivalent of par(mfrow = )
Dear r-helpers,
Does anyone have a straightforward example of putting together three
unrelated (expect for a common y-axis) xyplot() figures in what would
be in base graphics a par(mfrow = c(1, 3)) arrangement?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400 Charlottesville, VA 22904-4400
Parcels: Room 102
2004 May 11
1
calling data frames
Dear List,
I've around 1000 *.txt files, I've generate with other software.
I've now done the following code (below).
My question is how can I automate this (with do.call () ?), so it could be
done for all the *.txt files.
Thanks in advance,
Rog??rio
names<- list.files()
file <- "BLU_Var_%04d.txt"
for(i in 1:1000){
2010 May 11
1
Help with Names
Hi - a newbie question, if someone can please help....
I want to change X1, X2,,.....to X.1 X.2 etc in the names below. I am using
the Principal Component Regression function (pcr) and it seems to want it
this way
> datap3.pcr <- pcr(water ~ X, 10, data = datap3, Validation ="cv")
Error in model.frame.default(formula = water ~ X, data = datap3) :
invalid type (list) for