Displaying 20 results from an estimated 2000 matches similar to: "Aggregate Help"
2010 Aug 20
3
rollmean help (or similar function)
I am working on a simple pilot project comparing the capability of SQL,
SAS and R to perform a rolling mean per the following instructions. I
have completed the SQL and SAS analysis, so now it's R's turn.
Calculate mean values of x (x=count) for each date in the dataset where
mean = the average count of days [t-9] through day [t-3] for each
date/illness combination.
Dataset aggpilot
2012 Jan 15
1
Trouble installing packages on R2.14.1
Hi,
Have just recently downloaded R version 2.14.1 and can't install
packages (Code below), 32bit version on windows. From the looks of
things access is the problem but I don't know where to start, would it
be my system that is the problem or is the repository not set up for the
latest version yet?
Any ideas on how to rectify the problem would be greatly appreciated
Cheers
>
2012 Aug 04
1
how to coerce the result of sweep to be an array if result of FUN is a string?
Hi,
I would like to use sweep to "sweep out" proportions and confidence intervals for an array, however when I supply a function which returns a string (containing something like "9% (3-18%)") I get back a list instead of an array, here is a simplified example:
# example showing that sweep does not return an array with same dimensions as STATS as advertised
2013 Mar 07
1
create vector from indices interpolated values
Readers,
Is it possible to create a plot command based upon the indices of
missing values in a data set?
dataset1<-read.table(text='
10 2
20 NA
30 5
40 7
50 NA
60 NA
70 2
80 6
90 NA
100 9
')
dataset2<-read.table(text='
0.2
0.4
0.1
0.9
0.2
0.3
1.1
0.7
0.9
0.6
0.4
')
The 'approx' function is used to obtain the interpolated values for
'NA' in dataset1.
2017 Nov 08
3
Adding Records to a Table in R
Dear Eric,
Hope you are doing great. I also tried the following:
#First I created the complete date sequence
TransitDateFrame <- data.frame(TransitDate=seq(as.Date(dataset1[1,1]),
as.Date(dataset1[nrow(dataset1),1]), by = "month"))
#Then I did the merging
dataset1NEW <- merge(TransitDateFrame, dataset1, by="TransitDate",
all.x=TRUE)
Now it has, as expected the
2009 Nov 17
3
Perform operations on dataframes called with paste in loops
In a loop, I compose the name of a csv file using paste, then read it (e.g.,
dataset1.csv, dataset2.csv, etc). The name of the dataframe assigned to the
imported csv is also composed with paste (e.g., dataset1, dataset2, etc.).
Now I want to perform operations on the dataframes dataset1, dataset2, etc.
However, the paste function only renders a string on which I can not, for
example, do operations
2010 Dec 04
2
Question about #1 zoo-faq
Hi all,
I have a zoo object issue. When I create a zoo object I have following error
message: "some methods for 'zoo' objects do not work if the index entries in
'order.by' are not unique."
I checked if I have some duplicates in the 'Time' column, R says yes, but
when I check the data set I can't explain why. Here is the code.
>
2011 Oct 11
1
filtering rows
Hi everyone,
I've got two data sets as below. My question now is: how can I use Dataset2
as a filter for Dataset1? My goal is just to keep the rows of Dataset1 where
the first column (Date) matches the Dates in Dataset2.
I would appreciate any solutions to this issue.
Many thanks!
S.B.
Dataset1:
Date A B C D
1
2016 Feb 11
2
inconsistency in treatment of USE.NAMES argument
Changing the vapply() behavior makes sense in principle. I analyzed
the CRAN code base using the R parser and found 143 instances of
calling vapply with USE.NAMES=FALSE. These would need to be inspected
to understand the consequences of the change.
For reference:
/AzureML/R/datasets.R:226
/BBmisc/R/toRangeStr.R:33
/DBI/R/DBDriver.R:205
/Kmisc/R/str_rev.R:37
/Matrix/R/diagMatrix.R:98
2017 Nov 08
0
Adding Records to a Table in R
Hi
Instead of attachments copy directly result of dput(TransitDateFrame) and dput(dataset1) to your email. Or, if your data have more than about 20 rows you could copy only part of it.
dput(TransitDateFrame[,1:20])
dput(dataset1[,1:20])
Only with this approach we can evaluate your data in all aspects and provide correct answer.
Cheers
Petr
> -----Original Message-----
> From: R-help
2009 Sep 22
2
Creating loops with strings
Hello. I'm trying to run a series of commands in two different datasets. For
make it efficient I want to make a loop for it. Until now the only command
for loops i found it's the for() command it's only for series of numbers and
not a series of strings, witch it's what i'm needing. It would be something
like this
for(i in dataset1 dataset2) {
i <-
2011 Jun 01
1
Replacing variables in one dataset with those from another
Hoping someone out there can help me...this seems like an easy task but I
can't figure it out...
I want to replace variables in one dataset (Dataset1) with a variable from
another dataset (Dataset2).
All the values for variables x1 and x2 in Dataset1 have a unique match to
the variable uniquenum in Dataset2. For example, in Dataset1 grpnum A has a
value of 343 for variable x1. In Dataset2,
2012 Feb 09
1
sample points - sp package
When I make a sample in sp, for example a random samping of 5 points in
dataset1:
sample.dataset1=spsample(dataset1, n = 5, "random")
I have a sp object for the selected sampling...
My question is : How can I extract from dataset2 the points & data for the
coordinates(sample.dataset1) ?
The dataset2 would be an object with the same area and coordinate system,
but I would like to
2011 Jul 20
1
Latex Table for means and standard deviations in brackets
Hello all,
I am new to xtable. I have several datasets in the form of matrices.
Consider the following two simple datasets which are 2 x 3 matrices. The
rows in both matrices have the same meaning. For example the first row of
both matrices are variable 1 and the second row of both matrices are
variable 2.
dataset1 = matrix( c(1,2,3,4, 5, 6 ), 2 , 3)
dataset2 = matrix( c(4,3,5,10, 1, 0), 2, 3)
2012 Aug 09
2
correlating rows of two differently-sized data frames in R
Hello everyone,
I have two sets of data, with the following structure:
DataSet1
Location Part Sample 1 Sample 2
A 1 value value
A 2 value value
A 3 value value
B 1 value value
DataSet2
Location Sample 1 Sample 2
A
2016 Feb 08
2
inconsistency in treatment of USE.NAMES argument
Hi,
Both vapply() and sapply() support the 'USE.NAMES' argument. According
to the man page:
USE.NAMES: logical; if ?TRUE? and if ?X? is character, use ?X? as
?names? for the result unless it had names already.
But if 'X' has names already and 'USE.NAMES' is FALSE, it's not clear
what will happen to the names. Are they going to propagate to the
result
2009 Jul 15
1
loading multiple .Rdata and preserving variable names
Dear R-users,
I need to load outputs from multiple previous calculations into one R
session for comparison and (cross-)analysis. The previous calculations are
stored in different directories in .Rdata files (I don't know if this is the
best storage for later usage, but the previous project could be recalculated
and saved into different format, if needed, potentially.)
I can load consequently
2011 Jul 21
2
Latex Table Help on R
Hello everyone,
Peter (see my earlier post) recommended the following script for finding the
means and standard deviations and putting them in table form.
However, I would like the standard deviations under the means in brackets.
Can anyone check this code to see how this can be adjusted?
library(xtable)
dataset1 = matrix( c(1,2,3,4, 5, 6 ), 2 , 3)
dataset2 = matrix( c(4,3,5,10, 1, 0), 2, 3)
2006 Aug 02
1
questions on aggregate data
Dear friends,
my question is how to aggregate dataset and the inverse manipulation.
e.g.My dataset
data structure1:
x
1
1
2
3
3
data structure2:
x freq
1 2
2 1
3 2
Then how to generate dataset2 from dataset1 and generate dataset1 from
dataset2?
e.g. dataset2 from dataset1 :
x<-c(1,1,2,3,3)
a<-tab(x)
as.data.frame(a)
*But i can't do the inverse manipulation:generate dataset1 from
2010 Mar 03
5
Matching rows in a Data set? I'm Stuck!!
Hi, I'm having (yet another) problem with R.
I have a few data sets that have this sort of format
dataset1
ID DATA
1234 value
2345 value
3456 value
dataset2
ID DATA
1111 value
2345 value
3333 value
What i really want to do is write an R script that says "if the ID of
dataset1 and 2 match (2nd row), print out that whole row into a new
dataset3". No idea how to do that though.