Displaying 20 results from an estimated 6000 matches similar to: "plotting and coloring longitudinal data with three time points (ggplot2)"
2012 Mar 05
2
ggplot2
I just updated to R 2.14 with ggplot2 0.9 and am finding bugs.
> ggplot2 "GPL-2" "2.14.0"
This example is taken from pg 101 in the ggplot book.
> plot <- qplot(date, psavert, data = economics, geom = "line") +
> ylab("Personal savings rate") + geom_hline(xintercept = 0, colour =
> "grey50")'
> plot +
2010 Jun 18
2
help with reshape is needed again!
hi, folks:
i need to transpose the following data:
gene tissue patient1 patient2 patient3.....
---------------------------------------------
gene1 breast 10 100 1
gene2 breast 20 200 4
gene3 breast 30 50 5
gene4 breast 40 400 9
................................
to the
2009 Jun 01
2
ggplot2 and Date class
I'm trying to plot a time series in ggplot, but a date column in my
data frame is causing errors. Rather than provide my own data, I'll
just refer to the scale_date example at:
http://had.co.nz/ggplot2/scale_date.html
, which reproduces the error.
> df <- data.frame( date = seq(Sys.Date(), len=100, by="1 day")[sample(100, 50)], price = runif(50) )
> dt <- qplot(date,
2009 Nov 10
1
merge data
df1 -- dataframe with column date and several other columns. #rows >40k Several of the dates are repeated.
df2 -- dataframe with two columns date and index. #rows ~130 This is really a map from date to index.
I would like to create a column called index in df1 which has the corresponding index from df2.
The following works:
index <- NULL
for(wk in df1$week){
index <-
2009 Sep 20
2
missing level of a nested factor results in an NA in lm output
Hello All,
I have posted to this list before regarding the same issue so I
apologize for the multiple e-mails. I am still struggling with this
issue so I thought I'd give it another try. This time I have included
reproducible code and a subset of the data I am analyzing.
I am running an ANOVA with three factors: GROUP (5 levels), FEATURE
(2 levels), and PATIENT (2 levels), where
2010 May 14
2
operations between two aggregated data frames?
Hi All,
I've come up with a solution for this problem that relies on a for loop,
and I was wondering if anybody had any insight into a more elegant method:
I have two data frames, each has a column for categorical data and a column
for date. What I'd like to do, ideally, is calculate the number of days
between all pairs of dates in data frame 1 and data frame 2 (*but only for
members
2007 Jun 08
3
Barplots: Editing the frequency x-axis names
Hi
I have a timeSeries object (X) with monthly returns. I want to display the
returns with a barplot, which I can fix easily. But my problem is labaling
the x-axis, if I use the positions from the timeseries It gets very messy. I
have tried rotating and changing the font size but it doesn't do the trick.
I think the optimal solution for my purpose is too only display every second
or third
2010 Sep 14
3
how to compute when row length is different
hi guys..please help me with this
i am working on two data frames
one goes like this:
DF1
Sample_id RepairHours Denatured Dose ZeroMean FourtyFiveMean NinetyMean
1 SDM071 0 1 B 60.5 19.0 45.0
2 SDM071 1 1 B 46.0 23.0 42.5
3 SDM071 2 1 B 52.5 24.0 40.0
4 SDM071
2010 Apr 21
1
ggplot and scale_x_date
Hi all,
I have a question about setting arbitrary breaks/labels when using GGPLOT
and date/time data on the x-axis. I want to specify the breaks/limits
arbitrarily rather than using scale_x_date(major = 'blah'), much like when
arbitrarily defining breaks/labels using scale_x_discrete(breaks = blah,
labels = blah)
I have tried variants such as:
scale_x_date(major = seq(from =
2013 Mar 14
2
Grep with wildcards across multiple columns
I have a fairly large data set with six variables set up like the following dummy:
# Create fake data
df <- data.frame(code = c(rep(1001, 8), rep(1002, 8)),
year = rep(c(rep(2011, 4), rep(2012, 4)), 2),
fund = rep(c("10E", "10E", "10E", "27E"), 4),
func = rep(c("110000",
2009 Jul 11
2
Date conversions
Hi all,
I'm having a little bit of trouble with some date conversions and
am hoping someone can help me out. Thanks in advance.
OK, I have two sources of data that provide date info in a csv file
differently. I've attached a small zipped file with two text files
that illustrate both. (Is it ok to send attachments to this list? Not
sure. It's very small.) I need to be able to
2005 May 06
2
2 simple questions
Please excuse what I'm sure are very easy questions but I'm relatively new
to the R environment.
How can I view a range of list elements, but not all. e.g., I had a matrix
of patients and then split them out by patient id. I know I can do
patlist[[1]] to see the first one, but how can I view, say, the first ten
patients?
My other question is how to count how many patients have a
2012 Nov 10
4
help on date dataset
Hi everybody,
I am beginer in R and I need your precious help.
I want to create a small function in R as in sas to retrieve date.
I have a file with data that import in R.
DATE PAYS nb_pays.ILI.
1 24/04/2009 usa 0
2 24/04/2009 usa 0
3 24/04/2009 Mexique 0
4 24/04/2009
2012 Jan 06
1
ggplot using scale_x_date gives Error in seq.int(r1$year, to$year, by)
Dear all,
ggplot gives me an error when trying to plot time series data using a
date variable as the x axis.
g<-structure(list(Date = c("2011-12-23", "2011-12-30", "2012-01-06",
"2011-12-23", "2011-12-30", "2012-01-06", "2011-12-23", "2011-12-30",
"2012-01-06"), variable = structure(c(1L, 1L, 1L, 2L, 2L,
2013 Feb 14
3
Problems plotting and regression w.r.t. date data type on x axis
Hello,
probably a newbie question, but i didnt find any information on
plotting/regressing w.r.t. a date data type. My trials were unfruitful. Can
anyone help ? Thanks in advance!
Here is my interaction with R:
> tabelle
date number date2
1 2009-01-1 1673 2009-01-01
2 2009-12-1 2111 2009-12-01
3 2010-7-1 2487 2010-07-01
4 2013-2-1 4301 2013-02-01
> regression.punkte<-lm(tabelle$number
2010 Feb 16
3
converting character vector "hh:mm" to chron or strptime 24 clock time vectors
Hi All,
I am attempting to work with some data from loggers. I have read in a
.csv exported from MS Access that already has my dates and times (in 24
clock format), (with StringsAsFactors=FALSE).
> head(tdata)
LogData date time
1 77.16 2008/04/24 02:00
2 61.78 2008/04/24 04:00
3 75.44 2008/04/24 06:00
4 89.43 2008/04/24
2005 Feb 24
2
Row median of Date class variables in a data frame
I am trying to calculate the median of each row of a
data frame where the data frame consist of
columns of class Date.
Below are my test data and best attempt at using apply.
I didn't see a solution via Google or the Baron search
site.
I'd be grateful for any suggestions or solutions.
I'm using R 2.0.0 on Mac OS X.
Thank you,
Stephen Weigand
### Test data
date1 <- c(1000,
2015 Nov 06
4
Puzzled by eval
I am currently puzzled by a seach path behavior. I have a library of a dozen routines
getlabs(), getssn(), getecg(), ... that interface to local repositories and pull back
patient information. All have a the first 6 arguments in common, and immediately call a
second routine to do initial processing of these 6. The functions "joe" and "fred" below
capture the relevant
2009 Dec 09
1
reshape() makes R run out of memory (PR#14121)
Full_Name: Alexander L. Belikoff
Version: 2.8.1
OS: Ubuntu 9.04 (x86_64)
Submission from: (NULL) (67.244.71.200)
I'm trying to reshape the following data frame:
ID DATE1 DATE2 VALUE_TYPE VALUE
'abcd1233' 2009-11-12 2009-12-23 'TYPE1' 123.45
...
VALUE_TYPE is a string and is a factor with only 2 values
2012 May 12
1
Query regarding date as argument in functions - and about sqldf
Hi,
I have a query about sqldf, and dates in general. I couldnt find much on
the net or on the forums, hence I am here. Here is the issue:
I want to write a function that accepts 3 arguments: date1, date2 and a
dataframe, say 'df'. Within the function, I want to populate a temp
dataframe which essentially contains the output of the query "select * from
df where DATE between date1