, 2016 12:14 PM
To: Tom Mosca
Cc: jim holtman; Jianling Fan; r-help@r-project.org
Subject: Re: [R] means by year, month and day
If you are very inexperienced with R you still have time to forget you ever
heard
of the attach function. Your code
> attach(datATMP)
> datATMP1 <- datA
p working on it.
>
>
>
> Thank you for your kind response and examples. I will study them.
>
>
>
> Sincerely, Tom
>
>
>
>
>
>
> From: jim holtman [jholt...@gmail.com]
> Sent: Sunday, July 17, 2016 7:14 PM
> To: Jianling
do want to develop better form. So, I'll keep working on it.
Thank you for your kind response and examples. I will study them.
Sincerely, Tom
From: jim holtman [jholt...@gmail.com]
Sent: Sunday, July 17, 2016 7:14 PM
To: Jianling Fan
Cc: Tom Mosca;
Here is an example of using dplyr. Please provide a reasonable subset of
data. Your was all for the same date. Use 'dput' to put in your email.
> x <- read.table(text = " X.YY MM DD hh WDI R.WSP D.GST PRES ATMP
DEWP
+ 2015 1 1 0 328 3.6 4.5 1028.0 3.8 -3.5
+ 2015 1 1 1 3
Hello Tom,
try aggregate() or cast(). Both works.I prefer the latter.
library(reshape)
desc<-melt(mydata, measure.vars=c("WDI","R.WSP", "D.GST", "PRES",
"ATMP", "DEWP"),
id.vars=c("X.YY","MM","DD"))
summary<-cast(desc, X.YY+MM+DD~variable, mean)
On 17 July 2016 at 06:22, Tom
Hello Good Folk,
My dataframe looks like this:
> mydata
X.YY MM DD hh WDI R.WSP D.GST PRES ATMP DEWP
12015 1 1 0 328 3.6 4.5 1028.0 3.8 -3.5
22015 1 1 1 300 2.1 2.7 1027.9 3.7 -4.4
32015 1 1 2 264 2.4 2.9 1027.7 3.6 -4.5
42015 1 1 3 230 4
ginal Message -
From: Silvano Cesar da Costa
To: arun
Cc:
Sent: Wednesday, April 10, 2013 10:34 PM
Subject: Re: [R] means in tables
Arun,
this code work very well:
setwd('c:/Dados/')
list.files(pattern=".txt")
lst2 = lapply(list.files(pattern=".txt"), function
HI Silvano,
No problem.
Just wanted to make sure that it worked.
Regards,
A.K.
- Original Message -
From: Silvano Cesar da Costa
To: arun
Cc:
Sent: Wednesday, April 10, 2013 10:34 PM
Subject: Re: [R] means in tables
Arun,
this code work very well:
setwd('c:/Dados/')
0.012 0.373
dim(res)
#[1] 8000 3
A.K.
- Original Message -
From: Silvano Cesar da Costa
To: arun
Cc:
Sent: Wednesday, April 10, 2013 9:38 PM
Subject: Re: [R] means in tables
I performed all the procedures you described.
I read each file with the command:
lst2[[1]]; lst2[[2]]
.K.
- Original Message -
From: arun
To: Silvano Cesar da Costa
Cc: R help
Sent: Wednesday, April 10, 2013 6:28 PM
Subject: Re: [R] means in tables
Hi,
YOu can load all the datasets directly from the directory in a list.
set.seed(25)
lst1<-lapply(1:100,function(i)
as.data.fra
.72
mean(unlist(lapply(lst1,function(x) x[5,2])))
#[1] 20.97
A.K.
- Original Message -
From: Silvano Cesar da Costa
To: arun
Cc:
Sent: Wednesday, April 10, 2013 6:02 PM
Subject: Re: [R] means in tables
Hi Arun,
I thought with an example with two tables I could generalize to the 100
tab
roject.org
Cc:
Sent: Wednesday, April 10, 2013 12:07 PM
Subject: [R] means in tables
Hi.
I have 2 tables, with same dimensions (8000 x 5). Something like:
tab1:
V1 V2 V3 V4 V5
14.23 1.71 2.43 15.6 127
13.20 1.78 2.14 11.2 100
13.16 2.36 2.67 18.6 101
14.37 1.95 2.50 16.8 113
13.24 2.59 2.87
On Apr 10, 2013, at 11:07 AM, Silvano Cesar da Costa wrote:
> Hi.
>
> I have 2 tables, with same dimensions (8000 x 5). Something like:
>
> tab1:
>
> V1 V2 V3 V4 V5
> 14.23 1.71 2.43 15.6 127
> 13.20 1.78 2.14 11.2 100
> 13.16 2.36 2.67 18.6 101
> 14.37 1.95 2.50 16.8 113
> 13.24 2.59 2
Hi.
I have 2 tables, with same dimensions (8000 x 5). Something like:
tab1:
V1 V2 V3 V4 V5
14.23 1.71 2.43 15.6 127
13.20 1.78 2.14 11.2 100
13.16 2.36 2.67 18.6 101
14.37 1.95 2.50 16.8 113
13.24 2.59 2.87 21.0 118
tab2:
V1 V2 V3 V4 V5
1.23 1.1 2.3 1.6 17
1.20 1.8 2.4 1.2 10
1.1
On Thu, May 03, 2012 at 09:07:39PM -0400, li li wrote:
> Hi all,
>I have a 100 by 100 matrix and I divided this matrix into 100 groups,
> each is a
> 10 by 10 submatrix. I want find out the means of each group.
>I know we can use apply function for mean by margins. Is there a
> function i
Hi all,
I have a 100 by 100 matrix and I divided this matrix into 100 groups,
each is a
10 by 10 submatrix. I want find out the means of each group.
I know we can use apply function for mean by margins. Is there a
function in R for
means by groups also? Thanks.
Hannah
[[alter
I have a list of data frames like the following:
set.seed(123)
a<- data.frame(x=runif(10), y = runif(10), sample = seq(1,10))
b<- data.frame(x=runif(10), y = runif(10), sample = seq(1,10))
L<- list(a,b)
All data frames in the list have the same dimensions. I need to calculate
the sample means fo
On 2011-06-28 00:12, Louis Plough wrote:
Hi,
I have binary (0,1) data for a trait as my response variable, and
a dependent variable, genotype, with three classes (AA, AB, BB).
I would like to plot this data so that across the three genoytpes, even
though the points are all either 0 or 1, i want
Hi,
I have binary (0,1) data for a trait as my response variable, and
a dependent variable, genotype, with three classes (AA, AB, BB).
I would like to plot this data so that across the three genoytpes, even
though the points are all either 0 or 1, i want them to stack up or be seen
using 'jitter'.
Hi Christopher,
i think you have the same problem like me today :)
see this
http://r.789695.n4.nabble.com/group-by-in-data-frame-tc3324240.html post
i think you can find there the solution
zem
--
View this message in context:
http://r.789695.n4.nabble.com/means-SD-s-and-tapply-tp3325158p33
chris, it seems like you need the plyr package, esp ddply. for example:
stems353 <- data.frame(Time = rep(c("Modern", "Old"), 4),
SizeClass = rep(c("class1","class2"), each = 4),
Species = rep(c("a","b"), each = 4),
Stems = seq(1,8,1))
ddply(stems353, .(Species, SizeClass, Time), summarise,
mea
Hi:
On Fri, Feb 25, 2011 at 12:09 PM, Christopher R. Dolanc <
crdol...@ucdavis.edu> wrote:
> I'm trying to use tapply to output means and SD or SE for my data but
> seem to be limited by how many times I can subset it. Here's a snippet
> of my data
>
> > stems353[1:10,]
> Time DataSource
On Feb 25, 2011, at 3:09 PM, Christopher R. Dolanc wrote:
I'm trying to use tapply to output means and SD or SE for my data but
seem to be limited by how many times I can subset it. Here's a
snippet
of my data
stems353[1:10,]
Time DataSource Plot Elevation Aspect Slope Type Sp
I'm trying to use tapply to output means and SD or SE for my data but
seem to be limited by how many times I can subset it. Here's a snippet
of my data
> stems353[1:10,]
Time DataSource Plot Elevation Aspect Slope Type Species
SizeClass Stems
1 ModernCameron 70F221 1730
On 18-Feb-11 20:51:40, Dmitry Berman wrote:
> Listers,
>
> Is there a command/function to get the population standard deviation
> (N) and
> the sample standard deviation (n-1)
>
> Thanks
Using data (1:10), with N=10, as an example:
c(SampSD=1, PopSD=sqrt(9/10))*sd((1:10))
# SampSDPopS
Listers,
Is there a command/function to get the population standard deviation (N) and
the sample standard deviation (n-1)
Thanks
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-
On Jul 20, 2010, at 9:25 AM, David Winsemius wrote:
On Jul 20, 2010, at 9:13 AM, Marcus Drescher wrote:
Hi all,
I have a dataframe with survey data. Now I want to calculate means
from several but not all columns (e.g. a1, a2, a3) and save them in
a new separate column (e.g. a).
Well t
On Jul 20, 2010, at 9:13 AM, Marcus Drescher wrote:
Hi all,
I have a dataframe with survey data. Now I want to calculate means
from several but not all columns (e.g. a1, a2, a3) and save them in
a new separate column (e.g. a).
Well that would be possible unless you are in Minitab or Exce
Hi all,
I have a dataframe with survey data. Now I want to calculate means from several
but not all columns (e.g. a1, a2, a3) and save them in a new separate column
(e.g. a).
Like: a = mean(a1, a2, a3)
Can someone help me or give me the right key word to look for?
Thanks
[[alternativ
Yes thank you very much! I knew i had different data points for each subject
per condition but didn't realise that it would affect the averages of the
averages!
Thank you for helping me solve this big headache of mine for the past 2 days
=)
Regards,
Ruijie (RJ)
He who has a why can endu
Thanks for your help jim. I have attached the raw data to see if anyone else
can replicate my problem.
Regards,
Ruijie (RJ)
He who has a why can endure any how.
~ Friedrich Nietzsche
On 25 May 2010 00:17, jim holtman wrote:
> Are you sure that you have the same number of data points
Notice that only column 19 in your original had the same for the
average of the average and every entry had 32 data points.
On Mon, May 24, 2010 at 1:47 PM, jim holtman wrote:
> A quick check of you data shows that there are not the same number of
> sample in each of the different conditions, the
A quick check of you data shows that there are not the same number of
sample in each of the different conditions, therefore trying to take
the average of the averages will not work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
1 32 31 29 30 24 23 31 32 32 31 24 2
Thanks for your help jim. I have attached the raw data to see if anyone else
can replicate my problem.
Correction: i realise my attachment was too large, I have uploaded it to
another site. The link is:
http://dl.dropbox.com/u/1443460/List%20-%20Raw%20Data.csv
Regards,
Ruijie (RJ)
He w
Are you sure that you have the same number of data points in each of
the summary cells that you show in your csv file that was sent? You
need to provide a reproducible example of all the data so we can see
what you did. The best information I can provide at this point is
that you have a "bug" in
Noted.
I have attached a list of some data in csv format.
The first column is the SubID and the rest of the column are the mean of
each condition for the particular subject.
Average 1 is the average computed from each column in the list.
Average 2 is computed from the raw data of all the data po
Ruijie gmail.com> writes:
> In my experiment, I expose 10 subjects to 24 different conditions of
> stimuli. Each condition is exposed to the same subject 3x.
> This would make each subject have 24x3=72 data points. All the subjects
> combined would have 72x10=720 data points with each condition h
Hi all,
here is my situation
In my experiment, I expose 10 subjects to 24 different conditions of
stimuli. Each condition is exposed to the same subject 3x.
This would make each subject have 24x3=72 data points. All the subjects
combined would have 72x10=720 data points with each condition having
John Sorkin wrote:
R 2.8.0
windows XP
I would like to divide the rows of data frame into five groups and then get the
mean of one column within the five groups. I have accomplished this using the
code below, but I hope there is an easier way, i.e. some function that I can
call
# create five
discussurus
-
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im
Auftrag von John Sorkin
Gesendet: Wednesday, December 10, 2008 11:09 PM
An: r-help@r-project.org
Betreff: [R] means of a column within groups of a data frame
R 2.8.0
windows XP
R 2.8.0
windows XP
I would like to divide the rows of data frame into five groups and then get the
mean of one column within the five groups. I have accomplished this using the
code below, but I hope there is an easier way, i.e. some function that I can
call
# create five groups.
cut(data$BMI,
est per causas scire"
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, sel
In my situation under windows xp, after I setting the environment
variable R_LIBS, neither Rgui.exe nor Rterm.exe under cmd.exe doesn't
know the existence of R_LIBS.
After I enter the R interface, I find .libPaths() can add a new location
for installed packages:
> .libPaths("d:/progra~1/R/R
At 04:12 AM 8/28/2008, ONKELINX, Thierry wrote:
On a windows machine you get the same problem. Useless one uses tha same
trick as Rolf suggested: don't install the packages in the default
directory and set R_LIBS to that directory. Then all you need to do
after an upgrade is to set R_LIBS in the
Speaking for myself, I think it's easier to just create a script and
put it somewhere easy to remember.
For example
my.pkgs <- c('pkg1', 'pkg2') ## and so on for my preferred packages
install.packages(my.pkgs, dependencies=TRUE)
Then after each upgrade just source the script.
You will nee
On Thu, 28 Aug 2008, Michael Friendly wrote:
James Milks wrote:
The title says it all. Does anyone know of a way to save your packages
when you upgrade to a new version of R? This may seem petty, but I'm
accumulating enough packages that having to download and install each of
them anew ever
James Milks wrote:
The title says it all. Does anyone know of a way to save your packages
when you upgrade to a new version of R? This may seem petty, but I'm
accumulating enough packages that having to download and install each of
them anew every time I install a new version of R is rather o
On a windows machine you get the same problem. Useless one uses tha same
trick as Rolf suggested: don't install the packages in the default
directory and set R_LIBS to that directory. Then all you need to do
after an upgrade is to set R_LIBS in the new version and run
update.package(checkBuilt = T
Could this be related to the administrative rights of the user?
If a user had administrative rights, packages would be installed
into the /Library/Frameworks directory, and then updating (to, I
think a new major version) would remove them. Without the
administrative rights it would install the
On 28/08/2008, at 3:00 PM, Charilaos Skiadas wrote:
On Aug 27, 2008, at 10:40 PM, Rolf Turner wrote:
On 28/08/2008, at 2:02 PM, James Milks wrote:
The title says it all. Does anyone know of a way to save your
packages when you upgrade to a new version of R? This may seem
petty, but I'
On Aug 27, 2008, at 10:40 PM, Rolf Turner wrote:
On 28/08/2008, at 2:02 PM, James Milks wrote:
The title says it all. Does anyone know of a way to save your
packages when you upgrade to a new version of R? This may seem
petty, but I'm accumulating enough packages that having to
downloa
On 28/08/2008, at 2:02 PM, James Milks wrote:
The title says it all. Does anyone know of a way to save your
packages when you upgrade to a new version of R? This may seem
petty, but I'm accumulating enough packages that having to download
and install each of them anew every time I instal
The title says it all. Does anyone know of a way to save your
packages when you upgrade to a new version of R? This may seem petty,
but I'm accumulating enough packages that having to download and
install each of them anew every time I install a new version of R is
rather of a pain. Idea
Hy Katie,
There are many ways to do this. A simple one is to create a vector of
the same length than your 'x' vector, containing a group label.
> group=rep(c(1,2,3),times=nr[1,])
Then you can use tapply to apply a function (in this case mean and
variance) of the values of x within each group
kathie wrote:
> Dear R users,
>
> I have 32 observations in data x. After sorting this, I want to compute
> means and variances of 3 groups divided by "nr".
>
> Actually, the number of groups is flexible. Any suggestion will be greatly
> appreciated.
>
Hi Kathryn,
One way (there are many oth
Dear R users,
I have 32 observations in data x. After sorting this, I want to compute
means and variances of 3 groups divided by "nr".
Actually, the number of groups is flexible. Any suggestion will be greatly
appreciated.
Kathryn Lord
--
56 matches
Mail list logo