Displaying 20 results from an estimated 4000 matches similar to: "Aggregating a data frame (was: Re: new R-user needs help)"
2006 Oct 18
6
new R-user needs help
Dear all,
I have a dataset
Exp name id x1 x2 x3 x4 x5
1 a 1 23 24 23 22 30
1 b 2 25 26 27 23 24
1 c 3 32 19 23 25 28
2 a 4 28 32 24 26 27
2 b 5 23 24 25 26 28
2 c 6 23 31 30 38 23
3 a 7 24 25 31 27 29
3 b 8 28 25 26 32 28
3 c 9 21 31 28 23 29
where each name a,b and c is repeated three times.
Now I want to calculate the the averages of
2006 May 28
1
problems while correlating values
Hi,
I am a newbie to the world of R.
I have a data converted in csv format. Few cells in
some of the rows of the data are blank ( in the sense
that there is no value available for the particular
experiment). When i try to open the file in R. I get
an warning message.
The specific warning message i get is
{Warning message:
NAs introduced by coercion }
My data more or less looks like this
-
2011 Jul 27
0
Inversions in hierarchical clustering were they shouldn't be
Hi,
I''m using heatmap.2 to cluster my data, using the centroid method for clustering and the maximum method for calculating the distance matrix:
library("gplots")
library("RColorBrewer")
test <- matrix(c(0.96, 0.07, 0.97, 0.98, 0.50, 0.28, 0.29, 0.77,
0.08, 0.96, 0.51, 0.51, 0.14, 0.19, 0.41, 0.51),
ncol=4, byrow=TRUE)
2012 Jun 24
2
Defining multiple variables in a loop
Good day,
For lack of a better solution (or perhaps I am ignorant to something
more elegant), I have been bootstrapping panel data by hand so to
speak and I would like to know if there is a way to define multiple
variables in a loop using the loop variable. I found a post (here:
https://stat.ethz.ch/pipermail/r-help/2002-October/026305.html ) that
discussed naming multiple variables but it
2009 Feb 24
2
[LLVMdev] Detecting counted loops
I need to be able to detect a well-behaved loop. (i.e one where exp1
assigns a value to an int i, exp2 compares i with a loop constant,
exp3 adjusts i by a loop constant, and the inner block has no
assignments to i.)
I need this because in Sun's Java VM garbage collection only takes
place at safepoints, so a potentially unbounded loop must call
safepoint() some time. However, safepoints are
2001 Sep 13
1
row-wise dataframe calculation
Hi,
i have a dataframe such as:
Exp1 Exp2 Exp3
name1 12.6 78.0 45.6
name2 11.9 19.0 21.0
name3 10.0 14.0 17.0
...
...
...
Real datasets might be quite large - 20,000 rows by 100 columns
I want to calculate metrics such as the variation *row-wise*. So, var for name1, var for name 2, var for name3 etc.
Can someone kindly guide me on how best to code this?
Also, once such a metric has
2012 Nov 06
2
I am very confused about strip Stripe what way it hold space?
I have 4 dell 2970 server , three server harddisk is 146Gx6 ,one hard disk is 72Gx6:
each server mount info is
/dev/sda4 on /exp1 type xfs (rw)
/dev/sdb1 on /exp2 type xfs (rw)
/dev/sdc1 on /exp3 type xfs (rw)
/dev/sdd1 on /exp4 type xfs (rw)
/dev/sde1 on /exp5 type xfs (rw)
/dev/sdf1 on /exp6 type xfs (rw)
I create a gluster volume have 4 stripe
gluster volume create test-volume3 stripe 4
2011 May 21
0
Problem with ANOVA repeated measures: "Error() model is singular"
Hello everybody,
I need an help because I don´t know if the command for the ANOVA analysis I am
performing in R is correct. Indeed using the function aov I get the following error:"In aov (......) Error() model is singular"
The structure of my table is the following: subject, stimulus, condition, sex, response
Example:
subject stimulus condition sex response
2013 Nov 01
2
computation of hessian matrix
below is a code to compute hessian matrix , which i need to generate 29 number of different matrices for example first element in x1 and x2 is use to generate let say matrix (M1) and second element in x1 and x2 give matrix (M2) upto matrix (M29) corresponding to the total number of observations and b1 and b2 are constant.
can some one guide me or help to implement this please. I did not
2008 Apr 09
1
If statements for vectors
Dear Sirs,
I am using both the Bioconductor adds on (Affy, AffyPLM,...) and the
'standard' R-package.
I am trying to select a list of genes which all have expression values below
a certain threshold.
I have done this by creating a vector which has 0s where the expression is
greater than the threshold and 1s where it is less than or equal to it.
Multiplying this vector by the expression
2013 Jan 17
3
how to use "..."
Dear users,
I'm trying to learn how to use the "...".
I have written a function (simplified here) that uses doBy::summaryBy():
# 'dat' is a data.frame from which the aggregation is computed
# 'vec_cat' is a integer vector defining which columns of the data.frame
should be use on the right side of the formula
# 'stat_fun' is the function that will be run to
2010 Mar 17
2
Using nrow with summaryBy
Hello Everyone-
I'm calculating summary statistics on a dataset (~4000 records,
observations are not uniformly distributed) using summaryBy and trying
to add a column with the number of observations to the output as well.
What occurs to me is to use nrow(), but this doesn't appear to be working
I'm able to replicate the same results with an example from the
summaryBy docs:
2009 Jun 08
2
ridiculous behaviour printing to eps: labels all messed up!
OK, this is really weird!
here's an example code:
t1<-c(1,2,3,4)
t2<-c(4,2,4,2)
plot(t1~t2, xlab="exp1", ylab="exp2")
dev.copy2eps(file="test.eps")
that all seems fine...
until you look at the eps file created, where for some weird reason, if you
scroll down to the end, the code reads:
/Font1 findfont 12 s
0 setgray
214.02 18.72 (e) 0 ta
-0.360 (xp1) tb
2012 Apr 02
2
summaryBy: transformed variable on RHS of formula?
Hi Folks,
I'm trying to cut my data inside the summaryBy function. Perhaps
formulas don't work that way? I'd like to avoid adding another column
if possible, but if I have to, I have to. Any ideas?
Thanks,
Allie
require(doBy)
df = dataframe(a <- rnorm(100), b <-rnorm(100))
summaryBy(a ~ cut(b,c(-100,-1,1,100)), data=df) # preferred
solution, but it throws an
2012 Feb 20
0
repeating or looping within an apply statement to handle multiple variables
Dear R experts,
I would like to please ask for your help with repeating steps in an apply
statement.
I have a dataframe that lists multiple variables for a given id and visit,
as well as drug treatment.
> head(exp)
id visit variable1 variable2 variable3 variable4 drug
1 3 1 13 10 7 11 0
2 3 5 10 15 9 9 0
3 3 12
2011 Jan 17
2
Using summaryBy with weighted data
Dear Soren and R users:
I am trying to use the summaryBy function with weights. Is this possible? An example that illustrates what I am trying to do follows:
library(doBy)
## make up some data
response = rnorm(100)
group = c(rep(1,20), rep(2,20), rep(3,20), rep(4,20), rep(5,20))
weights = runif(100, 0, 1)
mydata = data.frame(response,group,weights)
## run summaryBy without weights:
2006 Feb 23
2
Strange p-level for the fixed effect with lme function
Hello,
I ran two lme analyses and got expected results. However, I saw
something suspicious regarding p-level for fixed effect. Models are the
same, only experimental designs differ and, of course, subjects. I am
aware that I could done nesting Subjects within Experiments, but it is
expected to have much slower RT (reaction time) in the second
experiment, since the task is more complex, so it
2009 Sep 04
1
Apparent bug in summaryBy (PR#13941)
Full_Name: Marc Paterno
Version: 2.9.2
OS: Mac OS X 10.5.8
Submission from: (NULL) (99.53.212.55)
summaryBy() produces incorrect results when given some data frames. Below is a
transcript of a session showing the result, in a data frame with 2 observations
of 2 variables.
-------------------
thomas:999 paterno$ R --vanilla
R version 2.9.2 (2009-08-24)
Copyright (C) 2009 The R Foundation for
2006 Dec 05
1
summaryBy(): Is it the best option?
Hi,
since I have quite large tables and the processing
takes quite a while I am
curious if I can improve the performance of this
aggregation somehow: At the
moment I am using summaryBy from the doBy package
under R 2.4.0, Win2K.
summaryBy(soc_s6aq5 + soc_s6aq7 + soc_s6aq9 +
soc_s6aq11 ~ hh +
comgroup,soc6a,postfix=c("","","",""),FUN=sum,
na.rm=T)
The
2012 May 15
0
Indexing in summaryBy
I'm trying to use a self-written function with the summaryBy function (doBy
package).
I have lots of data from Monte Carlo experiments comparing different
estimators across different (combinations of) parameter values, similar to
the following form:
colnames(mydata) <- c("X", "b0", "b1", # parameter combination,
corresponding (true) parameter values