Displaying 20 results from an estimated 10000 matches similar to: "lapply and boxplots with variable names"
2007 Aug 20
1
Q: combine 2 data frames with missing values
Een ingesloten tekst met niet-gespecificeerde tekenset is
van het bericht gescrubt ...
Naam: niet beschikbaar
Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070820/920567a6/attachment.pl
2003 Oct 08
2
Generating automatic plots
Hello,
I have been trying to write a small program to generate automatic plots. What
I want is to draw boxplots for some variables in my data frame, contrasting
with a variable called 'missing' that has value 1 if some variable in a
concrete case has at least one missing value, in order to check if the cases
that don't enter in my analysis are biased.
The first attempt was to
2016 Jul 18
2
Pregunta sobre boxplots
Colegas:
Tengo una pregunta rara, y ofrezco mis disculpas si es una tonteria.
Estoy tratando de hacer unos graficos con datos recolectados cada 24
horas, con varias replicas por cada periodo de tiempo. La mejor
representacion que he encontrado es hacer boxplots haciendo el tiempo una
variable categorica. Sin embargo, me gustaria tener una linea de regresion,
o ajuste usando splines o LOESS a
2012 Mar 12
3
lapply to change variable names and variable values
Hi: I'm sure this is a very easy problem. I've consulted Data Manipulation With R and the R Book and can't find an answer.
Sample list of data frames looks as follows:
.xx<-list(df<-data.frame(Var1=rep('Alabama', 400), Var2=rep(c(2004, 2005, 2006, 2007), 400)), df2<-data.frame(Var1=rep('Tennessee', 400), Var2=rep(c(2004,2005,2006,2007), 400)),
2005 Nov 29
1
Indexing variables within lapply?
Hello
I am using R 2.2.0 with Windows XP.
I've got a five element list object, each element containing two
dataframes of equivalent size.
> str(mylist)
List of 1
$ data1:List of 2
..$ data1a :`data.frame': 77 obs. of 63 variables:
.. ..$ var1 : num [1:77] 0.41375 0.00056 1.43040 1.43528 0.61730 ...
.. ..$ var2 : num [1:77] 1.154 1.686 0.673 0.800 0.760 ...
..
2012 Feb 09
1
Tukey HSD
Hey Folks:
New to R and learning as I go, but really, I know just enough to get myself
into trouble. I've waded through everything up till now, and don't see
anything in the search that is directly helpful for the POS that I've
created.
The GOAL: All I want in the world is a program that performs 1-way ANOVA's
on every column in a data set (taking the first column as the
2005 Apr 29
2
Automating plot labelling in custom function in lapply() ?
Dear List,
Consider the following example:
dat <- data.frame(var1 = rnorm(100), var2 = rnorm(100),
var3 = rnorm(100), var4 = rnorm(100))
oldpar <- par(mfrow = c(2,2), no.readonly = TRUE)
invisible(lapply(dat,
function(x) {
plot(density(x),
main = deparse(substitute(x))) }
)
)
2011 May 01
2
bwplot in ascending order
Can anyone point me to examples with R code where bwplot in lattice is used to order the boxes in ascending order? I have found the following discussion and it partly works. But, I have a conditioning variable, so my example is more like
bwplot(var1 ~ var2|condition, dat)
Th example in the discussion below works only when there is not a conditioning variable as far as I can tell. I can tweak the
2013 Mar 13
4
boxplot
Hi,
I try to boxplot following data on the subset of (V1,V3,V5,V7) and
(V2,V4,V6,V8)
V1 V2 V3 V4 V5 V6 V7 V8
2 4 6 7 12 33 43 53
how can I use boxplot function to plot it?
thanks,
William
2011 Oct 12
3
labels in a boxplot
Dear R-listers,
I have a little problem with a boxplot and I hope you can help me figuring
it out.
I'll try to make up some data to illustrate the issue. Sorry, if my
procedures look naive, but these are my first steps in R. Any comments
and/or suggestions are very welcome.
let's create a vector var1:
var1 <- rnorm(100)
and 5 five logical vectors. In this case the vectors don't
2010 Dec 19
3
monthly median in a daily dataset
Hello,
I have a multi-year dataset (see below) with date, a data value and a flag
for the data value. I want to find the monthly median for each month in this
dataset and then plot it. If anyone has suggestions they would be greatly
apperciated. It should be noted that there are some dates with no values and
they should be removed.
Thanks
Emily
> print ( str(data$flow$daily) )
2011 May 17
1
scales argument in bwplot (lattice)
Suppose I have data such as the following
set.seed(12345)
tmp <- data.frame(var1 = rnorm(100), var2 = rnorm(100), var3=rnorm(100, 10, 30))
tmp1 <- data.frame(vars = with(tmp, c(var1, var2, var3)), type = gl(3, 100))
var3 is on a different scale, but I create the following plot, which looks terrible as a result
bwplot(~ vars|type, tmp1,
layout = c(1,3),
)
Of course, I can
2004 Aug 17
5
Bug in colnames of data.frames?
Hi,
I am using R 1.9.1 on on i686 PC with SuSE Linux 9.0.
I have a data.frame, e.g.:
> myData <- data.frame( var1 = c( 1:4 ), var2 = c (5:8 ) )
If I add a new column by
> myData$var3 <- myData[ , "var1" ] + myData[ , "var2" ]
everything is fine, but if I omit the commas:
> myData$var4 <- myData[ "var1" ] + myData[ "var2" ]
the name
2009 Sep 22
3
converting a character vector to a function's input
Hi all, I have been trying to solve this problem and have had no luck so far.
I have numeric vectors VAR1, VAR2, and VAR3 which I am trying to cbind. I also have a character vector "VAR1,VAR2,VAR3". How do I manipulate this character vector such that I can input a transformed version of the character vector into cbind and have it recognize that I'm trying to refer to my numeric
2008 Jul 16
2
Group level frequencies
Dear List,
I have Multi-level Data
i= Indivitual Level
g= Group Level
var1= First Variable of interest
var2= Second Variable of interest
and I want to count the frequency of "var1" and "var2" on the group
level.
I found a way, but there must be a much simpler way.
data.ml <-
data.frame(i=c(1:8),g=as.factor(c(1,1,1,2,2,3,3,3)),var1=c(3,3,3,4,4,4,4
,4),
2014 Apr 11
6
crear variable en base a nombre de columnas que tienen un 1
Buenos días.
Hoy ando un poco (o bastante) espeso y no doy con la tecla de una cosa
que seguro que es muy simple..
Pongo un ejemplo.
var1 <- c(rep(0,3),rep(1,2))
var2 <- c(rep(1,2),0,0,1)
var3 <- c(rep(1,2),rep(0,3))
var4 <- c(rep(1,2),rep(0,3))
datos <- data.frame(fila=1:5,var1, var2, var3, var4)
datos
datos
fila var1 var2 var3 var4
1 1 0 1 1 1
2 2 0
2010 Dec 20
2
Turning a Variable into String
I would like to know how to turn a variable into a string. I have tried
as.symbol and as.name but it doesnt work for what I'd like to do
Essentially, I'd like to feed the function below with two variables. This
works fine in the bit working out number of elements in each variable.
In the print(sprintf("OK with %s and %s\n", var1, var2)) line I would like
var1 and var2 to be
2013 Dec 06
2
Using assign with mapply
I have a data frame whose first colum contains the names of the variables
and whose second colum contains the values to assign to them:
: kkk <- data.frame(vars=c("var1", "var2", "var3"),
vals=c(10, 20, 30), stringsAsFactors=F)
If I do
: assign(kkk$vars[1], kkk$vals[1])
it works
: var1
[1] 10
However, if I try with mapply
2014 Aug 21
2
pregunta
Estimados
Estoy entrenando hacer funciones que respondan a comandos,
en esta caso en la salida gráfica se observa que dice : Exposure=var3 y
outcome=var 1
quisiéramos que se reflejan los nombres de la base de datos : var1=estado,
var2=cake, var3=chocolate
Espero haberme explicado adecuadamente
Adjunto tabla con datos
####################################
#Comando que llama
2006 Jan 13
2
find mean of a list of timeseries
Can someone please give me a clue how to 're'write this so I dont need
to use loops.
a<-ts(matrix(c(1,1,1,10,10,10,20,20,20),nrow=3),names=c('var1','var2','var3'))
b<-ts(matrix(c(2,2,2,11,11,11,21,21,21),nrow=3),names=c('var1','var2','var3'))