Displaying 20 results from an estimated 10000 matches similar to: "Assigning Week Numbers"
2010 Mar 19
2
Dataframe calculations
Hi everyone,
My question will probably seem simple to most of you, but I
have spent many hours trying to solve it. I need to perform
a series of sequential calculations on my dataframe that move
across rows and down columns, and then repeat themselves at
each unique 'MM' by 'DD' grouping. Specifically, I want to add
'DEPART' time (24 hr time) to 'TRAVEL'(minutes)
2010 Aug 13
1
assign multiple variables at once
R Experts,
I would like to create a series of variables without having
to assign a separate line of code for each new variable. My dataframe (DF) contains
two groups of linked variables (ESP1:ESP9) and (ECRL1:ECRL9). Within ESP1:ESP9 are
abbreviated species codes (full dataframe contains 26 codes). ECRL1 represents the
number of species x in variable ESP1 harvested, and so on through ESP9 and
2013 Apr 11
1
Dotchart per groups
Hi all,
I would like to ask you for help. I did a dotplot - using dotchart
function.
There are two localites (loc) with values 75 or 56 in my data ZZ.
The f column has 4 levels: P1, S1, S8, R6.
The dataframe is ordered by N value, pchloc value is assign to use "pch" in
plot.
> head(ZZ)
loc f N color ordered pchloc
98 75 S1 6.39 green 1 16
99 75 S8 6.44 blue
2008 Feb 08
1
Can I index a dataframe with a reference from/to a second dataframe?
Hello,
I am unable to figure out how to code a new column in a data frame based
on an existing column that matches a column in a reference data frame,
in a relational-db fashion. I would like this to maintain a minimum set
of reference tables that may be reused over several similar datasets.
Specifically, I have two data frames as listed below, 'Bos' and 'tree.'
For each case in
2011 Jul 27
1
create a index.date column
Dear
R users,
I
created a matrix that tells me the first day of use of a category by
id.
#Calculate
time difference
test$tdiff<-as.numeric(difftime(as.Date("2002-09-01"), test$ftime, units = "days"))
#
obtain the index date per person and dcategory
index.date.test<-tapply(test$tdiff,
list(test$id, test$rcat), max)
Nonetheless,
at the moment I think will be
2009 May 28
2
ggplot2 legend
Hi:
I need some help with the legend. I got 14 samples(Muestreo) and I
am trying to plot a smooth line for each sample. I am able to accomplish that but the problem is that the legend only displays every other sample. How can I force the legend to show all of my Muestreos? Thanks in advance.
fish_ByMuestreo <- structure(list(data = structure(list(SampleDate = structure(c(3L,
3L, 3L, 3L,
2012 Nov 05
2
fusion of overlapping intervals
Hello,
I have start and end coordinates from different experiments (DNase
hypersensitivity data) and now I would like to combine overlapping
intervals. For instance (see my test data below) (2) 30-52 and (3) 49-101
are combined to 30-101. But 49-101 and 70-103 would not be combined because
they are on different chromosomes (chr a and chr b).
Does anybody have an idea?
Thanks
Hermann
> df
2013 Mar 08
2
Coversion from yearly to weekly data
Dear all, I have a big data matrix and I want to convert those data into
weekly basis which means 7 days needs to be avaraged and aggregate a single
value
> dput(test)
structure(list(locid = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
2011 Apr 17
1
side by side histogram after splitting data by year
Hi everyone,
I'm looking to produce a side-by-side histogram of the number of trips
taken by jays with a particular number of acorns after accounting for
year (year "one" and year "two"). I know this involves indexing first
then creating a histogram but I'm not sure how I'd do this. I want to
explore the possibilities that jays are altering their strategies in
2011 Jun 09
1
lattice plot query
Dear R Group
I have the following data for which I am trying to create subject wise
lattice plot for a given attribute and product .
though the lattice plot is generated, for some reasons that i dont
understand in each plot the subject panels take a random order, I would
rather want all the plots to display the subject order in the same order
as how i have ordered this particular factor level.
2017 Jul 30
1
Add Anova statistics in each figure
Hi R Users,
I created interaction plots in ggplot2 and was trying to add output of two way ANOVA models, especially only interaction ( example treatment*control F(XX, XX) = xxx, p = xxx) into figures, but i was not able to add. Would you mind to help on how I can add information into each figure? I have attached the example data and the code that I used for this.
dat<-structure(list(Sites
2009 Jan 12
1
Determining variance components of classed covariates
Hi -
I am interested in solving variance components for the data below with
respect to the response variable, Expression within R.
However, the covariates aren't independent and they also have a class
(of which the total variance explained by covariates in that class I am
most interested in).
Very naively, I have tried to look at each individual covariates
variance like this
>
2008 Jul 06
2
lattice question
I'm creating a lattice barchart based off a pretty complicated data
structure. The barchart comes out quite nice ( thanks
to lattice ) but the problem is that the horizontal axis comes out all
scrunched because the barchart doesn't know that the intervals
of Var.1 are really "associated" with the conditioning variable Var.2.
Therefore, all the intervals of Var.1 are put on
2010 Feb 04
1
for loop with if statment problem
Both of the approx functions work correctly individually, but they are
not being distinguished in the for loop by the if statments. Any help
would be appreciated. for loop of interest is below
x <- (structure(list(Site = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L,
2009 Oct 06
2
ggplot cumsum refined question (?)
OK, so maybe last night was a little too much at one throw, so I have
reduced the data to two stations- one that has precipitation and one
that does not. This is going to be in the context of a larger data
set. I would like to be able to issue a ggplot command and have cum
sum just act on the facets (factors) to apply this.
library(chron)
library(ggplot2)
DF <- structure(list(date_time =
2009 May 15
1
data summary and some automated t.tests.
I would like to preform a t.test to each of the measured variables
(sand.silt etc.) with a mean and sd for each of the treatments (up or
down), and out put this as a table.... I am having a hard time
starting- maybe it is to close to lunch. Any suggestions would be
greatly appreciated.
Stephen Sefick
x <- (structure(list(sample. = structure(c(1L, 7L, 8L, 9L, 10L, 11L,
12L, 13L, 14L, 2L, 3L,
2012 Mar 14
1
Questing on fitting Baseline category Logit model
Dear all,
I am facing some problem with how to fit a "Baseline category Logit
model" with R. Basically I am considering famous "Alligator" data as
discussed by Agresti. This data can also be found here:
https://onlinecourses.science.psu.edu/stat504/node/174
(there is also an accompanying R file, however the underlying R code
could not load the data properly!!!)
Below are
2011 Nov 08
2
nesting scale_manual caracteristics in ggplot
Hi there,
I am having a little problem with combining three scale_manual commands in a
facet plot. I am not able to combine the three different characteristics,
instead ending up with three different descriptions next to the graph for
the same geom. I would like to see two separate labels (not three); one
describing lines 1-7 and the other 8-14. For each of the treatments (A-B) I
want a
2009 Nov 26
1
lattice --- different properties of lines corresponding to type=c("l", "a") respectively
I think the subject says it all. I want to make a simple lattice plot,
using xyplot with the
argument type=c("l","a").
The problem then is that in the resulting plot it is
difficult/impossible to see which plot corresponds to the average
and which to the individual profiles. I triedthings like extra
arguments lwd=c(1,3) or col=c("blue","red")
hoping
2010 Feb 09
1
Missing interaction effect in binomial GLMM with lmer
Dear all,
I was wondering if anyone could help solve a problem of a missing interaction effect!!
I carried out a 2 x 2 factorial experiment to see if eggs from 2 different locations (Origin = 1 or 2) had different hatching success under 2 different incubation schedules (Treat = 1 or 2). Six eggs were taken from 10 females (random = Female) at each location and split between the treatments,