Displaying 20 results from an estimated 3000 matches similar to: "plotting time series using ggplots"
2008 Aug 22
2
Combining multiple datasets
Hi,
I've tried to figure this out using Intro to R and help(), to no avail
- I am new at this.
I'm trying to write a script that will read multiple files from a
directory and then merge them into a single new data frame.
The original data are in a tree-ring specific format, and so I've first
used a function (read.rwl) from the dplR package to read each file,
translate each into a
2023 Aug 12
2
geom_smooth
Colleagues,
Here is my reproducible code for a graph using geom_smooth
set.seed(55)
scatter_data <- tibble(x_var = runif(100, min = 0, max = 25)
?????????????????????? ,y_var = log2(x_var) + rnorm(100))
library(ggplot2)
library(cowplot)
ggplot(scatter_data,aes(x=x_var,y=y_var))+
? geom_point()+
? geom_smooth(se=TRUE,fill="blue",color="black",linetype="dashed")+
2023 Aug 12
1
geom_smooth
?s 05:17 de 12/08/2023, Thomas Subia via R-help escreveu:
> Colleagues,
>
> Here is my reproducible code for a graph using geom_smooth
> set.seed(55)
> scatter_data <- tibble(x_var = runif(100, min = 0, max = 25)
> ?????????????????????? ,y_var = log2(x_var) + rnorm(100))
>
> library(ggplot2)
> library(cowplot)
>
> ggplot(scatter_data,aes(x=x_var,y=y_var))+
2010 May 30
2
geom_ribbon removes missing values
Hi everyone,
it looks like geom_ribbon removes missing values and plots a single
ribbon over the whole interval of x values. However, I'd rather want it
to act like geom_line, that is, interrupt the ribbon for the interval of
missing values and continue once there are new values. Here's an example:
library(ggplot2)
df <- data.frame(
date = seq(from = as.Date("2010-05-15"),
2009 Apr 23
1
ggplot2/aesthetic plotting advice
Consider the following situation:
we have quantified algal concentrations for
a variety of species using many samples at each
of three years. It seems to make sense to generate
a line plot (matplot-like), with each species plotted
as a separate line, with the points connected to emphasize
the temporal pattern.
The problem: lots of overlapping error bars.
The question: from both a
2023 Aug 12
1
geom_smooth
G'day Thomas,
On Sat, 12 Aug 2023 04:17:42 +0000 (UTC)
Thomas Subia via R-help <r-help at r-project.org> wrote:
> Here is my reproducible code for a graph using geom_smooth
The call "library(tidyverse)" was missing. :)
> I'd like to add a black boundary around the shaded area. I suspect
> this can be done with geom_ribbon but I cannot figure this out. Some
>
2010 Oct 19
2
superpose.polygon, panel.polygon and their colors
Dear R-helpers,
the problem I'm facing today is to convince lattice to paint some areas
in gray.
The areas I would like to have in gray, are confidence bands
I've googled around in the mailing list archives and eventually find
some clues.
This link is my starting point
http://tolstoy.newcastle.edu.au/R/e2/help/07/04/15595.html
I'm reproducing here the code for your convenience
est
2010 Sep 22
2
speeding up regressions using ddply
Hi,
I have a data set that I'd like to run logistic regressions on, using
ddply to speed up the computation of many models with different
combinations of variables. I would like to run regressions on every
unique two-variable combination in a portion of my data set, but I
can't quite figure out how to do using ddply. The data set looks like
this, with "status" as
2020 Oct 23
0
How to shade area between lines in ggplot2
Hi
Did you try google? I got several answers using your question
e.g.
https://stackoverflow.com/questions/54687321/fill-area-between-lines-using-g
gplot-in-r
Cheers
Petr
> -----Original Message-----
> From: R-help <r-help-bounces at r-project.org> On Behalf Of Luigi Marongiu
> Sent: Friday, October 23, 2020 9:59 AM
> To: r-help <r-help at r-project.org>
> Subject:
2020 Oct 23
2
How to shade area between lines in ggplot2
Thank you, but this split the area into two and distorts the shape of
the plot. (compared to
```
p + geom_abline(slope = slope_1, intercept = intercept_1 - 1/w[2],
linetype = "dashed", col = "royalblue") +
geom_abline(slope = slope_1, intercept = intercept_1 + 1/w[2],
linetype = "dashed", col = "royalblue")
```
Why there
2020 Oct 23
5
How to shade area between lines in ggplot2
Hello,
I am running SVM and showing the results with ggplot2. The results
include the decision boundaries, which are two dashed lines parallel
to a solid line. I would like to remove the dashed lines and use a
shaded area instead. How can I do that?
Here is the code I wrote..
```
library(e1071)
library(ggplot2)
set.seed(100)
x1 = rnorm(100, mean = 0.2, sd = 0.1)
y1 = rnorm(100, mean = 0.7, sd =
2009 Sep 14
1
ggplot, ribbon not showing up properly
Hi,
I'm trying to plot a longitudinal data set, using ggplot and adding some
summary info (eg. mean, 1 sd bounds) using geom=ribbon. The summary
info is based on a subset of the original data (eg. less an outlier).
But I'm having trouble getting the ribbons to show up correctly. It's
probably something obvious that I'm missing as a novice at ggplot2, and
any help is much
2020 Oct 26
0
How to shade area between lines in ggplot2
Hi
Put fill outside aes
p+geom_ribbon(aes(ymin = slope_1*x + intercept_1 - 1/w[2],
ymax = slope_1*x + intercept_1 + 1/w[2]), fill = "blue", alpha=0.1)
The "hole" is because you have two levels of data (red and blue). To get rid
of this you should put new data in ribbon call.
Something like
newdat <- trainset
newdat$z <- factor(0)
p+geom_ribbon(data=newdat, aes(ymin =
2008 Jun 24
3
loop with files
I'm trying to make a loop with many files...
> library(dplR)
>
> files <- system("ls *.rwl", intern=TRUE)
>
> files
[1] "cimfasy.rwl" "rocquce.rwl"
> for (i in files) {a <- read.rwl(i,header=0)}
There are 70 series
There are 21 series
> class(a)
[1] "data.frame"
This loop import all the files rwl in a single data.frame ( a
2008 Jun 25
1
a loop....
I'm trying to make a loopo with some file....
>
> library(dplR)
> files.rwl <- system("ls *.rwl", intern=TRUE) > files.rwl
[1] "cimfasy.rwl" "rocquce.rwl"
> for (i in files.rwl) assign(gsub("\\.rwl$", "_rwl", i), read.rwl(i, header=0))
There are 70 series
There are 21 series
>
> cimfasy_rwl
1990 1.55 0.00
2020 Oct 23
2
How to shade area between lines in ggplot2
also from this site: https://plotly.com/ggplot2/geom_ribbon/
I get the answer is geom_ribbon but I am still missing something
```
#! plot
p = ggplot(data = trainset, aes(x=x, y=y, color=z)) +
geom_point() + scale_color_manual(values = c("red", "blue"))
# show support vectors
df_sv = trainset[svm_model$index, ]
p = p + geom_point(data = df_sv, aes(x=x, y=y),
2008 Jun 19
3
colnames of a column
Hi,
With this data.frame:
> class(rwl)
[1] "data.frame"
>rwl
0028002F 0028013F 0028032F
1833 3.39 NA NA
1834 3.09 NA NA
1835 3.05 NA NA
1836 3.31 NA NA
1837 2.26 NA NA
> colnames(rwl)
[1] "0028002F" "0028013F" "0028032F"
Ok....
> colnames(rwl[,1])
NULL
why??
2007 Sep 03
1
Legend issue with ggplot2
Dear useRs,
I'm struggling with the new version of ggplot2. In the previous version
I did something like this. But now this yield an error (object "fill"
not found).
library(ggplot2)
dummy <- data.frame(x = rep(1:10, 4), group = gl(4, 10))
dummy$y <- dummy$x * rnorm(4)[dummy$group] + 5 * rnorm(4)[dummy$group]
dummy$min <- dummy$y - 5
dummy$max <- dummy$y + 5
ggplot(data
2010 Aug 23
2
change order of plot panels in faceted ggplot/qplot
Hi,
I have a 5-paneled figure that i made using the facet function in
qplot (ggplot). I've managed to arrange the panels into two rows/
three columns, but for the sake of easy visual comparisons between
panels in my particular dataset, I want to have the two plots on the
bottom align on the right hand side of the figure instead of the left.
Here's an example:
m <-
2008 Feb 17
1
ggplot2: bug in geom_ribbon + log scale!?
Hi everyone, Hadley,
it seems there's a bug in geom_ribbon() when using it in a log-scaled plot:
d<-data.frame(x=c(1:20),y1=rnorm(20)+3,y2=rnorm(20)+5)
p<-ggplot()
p<-p+geom_ribbon(data=d,aes(x=d[["x"]],min=d[["y1"]],max=d[["y2"]]))
p<-p+geom_line(data=d,aes(x=d[["x"]],y=d[["y1"]]),colour="blue")