om: R-help On Behalf Of Sorkin, John
Sent: Thursday, December 5, 2024 8:38 PM
To: r-help@r-project.org (r-help@r-project.org)
Subject: [R] ggplot2: Plot multiple lines using stacked data.
I am trying to use ggplot2 to create a figure with multiple lines, one line
for each value of the variable
I am trying to use ggplot2 to create a figure with multiple lines, one line for
each value of the variable Day. Each group of data for Day requires seven
lines. The dataframe has data for 4 days and thus 4*7=28 lines.
I can create a plot, but the plot only contains dots. The dots for each day
s
Às 00:36 de 13/12/2023, Robert Baer escreveu:
coord_cartesian also seems to work for y, and including the breaks = .
How about:
df=data.frame(year= c(2012,2015,2018,2022),
score=c(495,493, 495, 474))
ggplot(df, aes(x = year, y = score)) +
geom_point() +
geom_smooth(method
y = "PISA score in mathematics") +
scale_y_continuous(limits=c(470,500),oob=scales::squish)
Regards,
Tim
-Original Message-
From: R-help On Behalf Of varin sacha via R-help
Sent: Tuesday, December 12, 2023 4:19 PM
To: r-help@r-project.org; Ben Bolker
Subject: Re: [R] ggplot2: Get the r
coord_cartesian also seems to work for y, and including the breaks = .
How about:
df=data.frame(year= c(2012,2015,2018,2022),
score=c(495,493, 495, 474))
ggplot(df, aes(x = year, y = score)) +
geom_point() +
geom_smooth(method = "lm", formula = y ~ x) +
labs(title = "Standa
Use scale_x_continuous() and specify your desired breaks
On Tue, Dec 12, 2023, 4:19 PM varin sacha wrote:
> Dear Ben,
> Dear Daniel,
> Dear Rui,
> Dear Bert,
>
> Here below my R code.
> I really appreciate all your comments. My R code is perfectly working but
> there is still something I would l
Dear Ben,
Dear Daniel,
Dear Rui,
Dear Bert,
Here below my R code.
I really appreciate all your comments. My R code is perfectly working but there
is still something I would like to improve. The X-axis is showing 2012.5 ;
2015.0 ; 2017.5 ; 2020.0
I would like to see on X-axis only the
On 2023-12-11 5:27 p.m., Daniel Nordlund wrote:
On 12/10/2023 2:50 PM, Rui Barradas wrote:
Às 22:35 de 10/12/2023, varin sacha via R-help escreveu:
Dear R-experts,
Here below my R code, as my X-axis is "year", I must be missing one
or more steps! I am trying to get the regression line wit
On 12/10/2023 2:50 PM, Rui Barradas wrote:
Às 22:35 de 10/12/2023, varin sacha via R-help escreveu:
Dear R-experts,
Here below my R code, as my X-axis is "year", I must be missing one
or more steps! I am trying to get the regression line with the 95%
confidence bands around the regression li
This can easily be done using predict.lm to get the intervals (confidence
or prediction).
?predict.lm contains a plotting example using ?matplot from the graphics
package. Here's a somewhat verbose version for your example (first
converting Year to numeric, of course):
df=data.frame(year= c(2012,2
Às 22:35 de 10/12/2023, varin sacha via R-help escreveu:
Dear R-experts,
Here below my R code, as my X-axis is "year", I must be missing one or more
steps! I am trying to get the regression line with the 95% confidence bands around the
regression line. Any help would be appreciated.
Best,
S.
Dear R-experts,
Here below my R code, as my X-axis is "year", I must be missing one or more
steps! I am trying to get the regression line with the 95% confidence bands
around the regression line. Any help would be appreciated.
Best,
S.
#
library(g
On Mon, 10 Oct 2022 15:32:33 +0200
wrote:
> Error in nchar(homeDir) : invalid multibyte string, element 1
I searched for nchar(homeDir) in the R source code and on CRAN (as
indexed by GitHub), and the only CRAN match was probably unrelated (in
the ibmdbR package).
There's also a few matches in
ron
Gesendet: Dienstag, 11. Oktober 2022 02:42
An: sibylle.stoec...@gmx.ch; R-help@r-project.org
Betreff: RE: [R] ggplot2 install.package
Can you please provide us with a copy of the error msg? I have used ggplot2
with R 4.2.1, and probably R 4.2.0 in RStudio on Windows 11 and not had
trouble. You might n
An: sibylle.stoec...@gmx.ch; R-help@r-project.org
Betreff: RE: [R] ggplot2 install.package
Can you please provide us with a copy of the error msg? I have used ggplot2
with R 4.2.1, and probably R 4.2.0 in RStudio on Windows 11 and not had
trouble. You might need to update R, or RStudio. R and
Behalf Of sibylle.stoec...@gmx.ch
Sent: Monday, October 10, 2022 9:33 AM
To: R-help@r-project.org
Subject: [R] ggplot2 install.package
[External Email]
Dear R members
I am working with RStudio R 4.2.0 and using ggplot2 and gridExtra.
Since some windows updates I get some error when loading
Dear R members
I am working with RStudio R 4.2.0 and using ggplot2 and gridExtra.
Since some windows updates I get some error when loading ggplot2.
* It seems that I am able to install ggplot2. The problem is when
loading ggplot2 with library().
* Do you have any ideas to solve
hi, Richard,
> I get these warnings, and the package did not install:
...
> 1: In install.packages("ggplot2", dependencies = TRUE) :
> installation of package ‘curl’ had non-zero exit status
Ivan and Kimmo have both pointed out you need the right development
tools.
in terms of debugging your p
t
> was offered.
>
> --
> David
>
> > library(ggplot2)
> >
> > An alternative
> > install.packages("tidyverse")
> > library(tidyverse)
> >
> > The first only installs ggplot2. The alternative installs a bunch of
> other stuff a
essage-
From: R-help On Behalf Of Richard Vickery
Sent: Sunday, April 3, 2022 12:49 PM
To: R-help@r-project.org
Subject: [R] ggplot2
[External Email]
Hi there,
I am finally getting to some material I had problems with in university, where I was
introduced to R - one of those that because of
Hi there,
I am finally getting to some material I had problems with in university,
where I was introduced to R - one of those that because of time
constraints, I had challenges figuring out, particularly because I decided
long ago on using Fedora Linux. The book, "Understanding Statistics Using
R"
me to discuss this, so
>forget I said anything.
>
>
>
>
>-Original Message-
>From: Michael Bonert
>To: r-help@r-project.org
>Sent: Sun, Feb 27, 2022 8:02 pm
>Subject: [R] ggplot2 with an arbitrary number of curves from geom_function +
>legend?
>
>
ltiple vertical (or horizontal) lines by supplying a vector of
positions.
But as noted, this is not considered a good place by some to discuss this, so
forget I said anything.
-Original Message-
From: Michael Bonert
To: r-help@r-project.org
Sent: Sun, Feb 27, 2022 8:02 pm
Subje
On Fri, 12 Nov 2021, Chris Evans wrote:
I think it's your xlab. Should be:
Chris,
Ah, I should know better, but I didn't relate the error message to that
line.
Thank you.
Rich
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
From: "Rich Shepard"
> To: r-help@r-project.org
> Sent: Friday, 12 November, 2021 19:23:18
> Subject: [R] ggplot2: 'not finding <-<- error'
> I'm writing a script to plot data distributions. It worked in a basic form
> and I'm now adding
I'm writing a script to plot data distributions. It worked in a basic form
and I'm now adding features and tweaking the presentation. When I sourced
the file this error appeared:
Error in p1 <- ggplot(data = pdx_disc, aes(x = NULL, y = cfs)) + geom_boxplot(color =
"#8B", (from all_disc_boxp
On Thu, 11 Nov 2021, John Dougherty wrote:
You should probably glance at the R Graphics Cookbook. That was my gateway
to ggplot. I believe ggplot is a part of the tidyverse so there should
good information.
John,
I have Hadley's ggplot2 book and keep referring to it but haven't used it
before
On Wed, 10 Nov 2021 11:44:07 -0800 (PST)
Rich Shepard wrote:
> I have the code to create ggplot2 boxplots using two attributes (e.g.,
> chemical concentration and month) from the same tibble. Is there an
> example from which I can learn how to make boxplots from different
> tibbles/dataframes (e.
On Thu, 11 Nov 2021, Avi Gross via R-help wrote:
This is not a place designed for using packages but since this discussion
persists, ...
Avi,
I'll find a cowplot help site.
# Create and save two ggplots, or more in your case:
p1 <- ggplot(data=df1, aes(x=NULL, y=cfs)) +
geom_boxplot(color
quot;yellow")
p2 <- ggplot(data=df2, aes(x=NULL, y=cfs)) +
geom_boxplot(color="green", fill="pink")
# combine the two or more verically using the plot_grid() from cowplot
plot_grid(p1, p2, ncol=1)
#END OF CODE
-Original Message-
From: R-help On Behalf Of Rich Shepar
On Thu, 11 Nov 2021, Avi Gross wrote:
Your message was just to me so the reply is also just to you.
Avi,
Oops! Mea cupla.
Yes, large data sets can be handled if your machine has the memory and one
big one takes up the same amount as four smaller ones if combined.
This desktop has 32G RAM
On Thu, 11 Nov 2021, Bert Gunter wrote:
These days, 3e6 rows x 3 columns is small, unless large objects are in
each cell.
I think R would handle this with ease.
Thanks, Bert. See my last post showing data set structure and suggested
collection for use by grouping.
Regards,
Rich
___
.
-Original Message-
From: R-help On Behalf Of Rich Shepard
Sent: Thursday, November 11, 2021 12:56 PM
To: R-help
Subject: Re: [R] ggplot2: multiple box plots, different tibbles/dataframes
On Thu, 11 Nov 2021, Bert Gunter wrote:
> You can always create a graphics layout and then p
On Thu, 11 Nov 2021, Avi Gross via R-help wrote:
Say I have a data.frame with columns called PLACE and MEASURE others. The
one I call PLACE would be a factor containing the locations you are
measuring at. I mean it would be character strings of your N places but
the factors would be made in the
On Thu, 11 Nov 2021, Bert Gunter wrote:
You can always create a graphics layout and then plot different
ggplot objects in the separate regions of the layout. See ?grid.layout
(since ggplots are grobs) and ?plot.ggplot . This also **may** be
useful by showing examples using grid.arrange()
htt
You can always create a graphics layout and then plot different
ggplot objects in the separate regions of the layout. See ?grid.layout
(since ggplots are grobs) and ?plot.ggplot . This also **may** be
useful by showing examples using grid.arrange()
https://cran.r-project.org/web/packages/egg/vi
facet_wrap() as various ways to do this. Note you
may want to examine some options such as setting the scales to be the same
or free.
-Original Message-
From: R-help On Behalf Of Rich Shepard
Sent: Thursday, November 11, 2021 12:22 PM
To: r-help@r-project.org
Subject: Re: [R] ggplot2
On Thu, 11 Nov 2021, Avi Gross wrote:
Boxplots like many other things in ggplot can be grouped in various ways.
I often do something like this:
Avi,
I've designed and used multiple boxplots in many projects. They might show
geochemical concentrations at two locations or in two (or three) sepa
Behalf Of Rich Shepard
Sent: Thursday, November 11, 2021 8:50 AM
To: r-help@r-project.org
Subject: Re: [R] ggplot2: multiple box plots, different tibbles/dataframes
On Wed, 10 Nov 2021, Avi Gross via R-help wrote:
> I think many here may not quite have enough info to help you.
Avi,
Actua
On Thu, 11 Nov 2021, Jeff Newmiller wrote:
I strongly recommend that you change your way of thinking when it comes to
ggplot: if your data are not yet in one data frame then your data are not
yet ready for plotting.
It is possible to specify separate data frames for different layers of the
pl
I strongly recommend that you change your way of thinking when it comes to
ggplot: if your data are not yet in one data frame then your data are not yet
ready for plotting.
It is possible to specify separate data frames for different layers of the
plot, but this severely complicates building le
On Wed, 10 Nov 2021, Rich Shepard wrote:
I have the code to create ggplot2 boxplots using two attributes (e.g.,
chemical concentration and month) from the same tibble. Is there an
example from which I can learn how to make boxplots from different
tibbles/dataframes (e.g., chemical concentrations
On Thu, 11 Nov 2021, Bill Dunlap wrote:
I googled for "ggplot2 boxplots by group" and the first hit was
https://www.r-graph-gallery.com/265-grouped-boxplot-with-ggplot2.html
which displays lots of variants along with the code to produce them. It
has links to ungrouped boxplots and shows how vi
On Thu, 11 Nov 2021, Bill Dunlap wrote:
I googled for "ggplot2 boxplots by group" and the first hit was
https://www.r-graph-gallery.com/265-grouped-boxplot-with-ggplot2.html
which displays lots of variants along with the code to produce them. It
has links to ungrouped boxplots and shows how vi
I googled for "ggplot2 boxplots by group" and the first hit was
https://www.r-graph-gallery.com/265-grouped-boxplot-with-ggplot2.html
which displays lots of variants along with the code to produce them. It
has links to ungrouped boxplots and shows how violin plots can better
display your data.
On Wed, 10 Nov 2021, Avi Gross via R-help wrote:
I think many here may not quite have enough info to help you.
Avi,
Actually, you've reflected my thinking.
But the subject of multiple plots has come up. There are a slew of ways,
especially in the ggplot paradigm, to make multiple smaller pl
.
So, although it may also be possible to do whatever it is you want within a
single plot, it may also make sense to do it as loosely described above.
-Original Message-
From: R-help On Behalf Of Rich Shepard
Sent: Wednesday, November 10, 2021 4:53 PM
To: R-help
Subject: Re: [R] ggplot2
On Wed, 10 Nov 2021, Bert Gunter wrote:
As always, online search (on "ggplot2 help") seemed to bring up useful
resources. I suggest you look here (suggested tutorials and resources are
farther down the page): https://ggplot2.tidyverse.org/
Bert,
My web search was for multiple boxplots and I d
As always, online search (on "ggplot2 help") seemed to bring up useful
resources.
I suggest you look here (suggested tutorials and resources are farther
down the page):
https://ggplot2.tidyverse.org/
Bert Gunter
On Wed, Nov 10, 2021 at 12:16 PM Rich Shepard wrote:
>
> On Wed, 10 Nov 2021, Rich
On Wed, 10 Nov 2021, Rich Shepard wrote:
I have the code to create ggplot2 boxplots using two attributes (e.g.,
chemical concentration and month) from the same tibble. Is there an
example from which I can learn how to make boxplots from different
tibbles/dataframes (e.g., chemical concentrations
I have the code to create ggplot2 boxplots using two attributes (e.g.,
chemical concentration and month) from the same tibble. Is there an example
from which I can learn how to make boxplots from different
tibbles/dataframes (e.g., chemical concentrations and monitoring location)?
TIA,
Rich
___
I could, but this question is off topic on this mailing list. Read the Posting
Guide before you post again. Help for ggplot2 can be found in many places...
start your search here
https://cran.r-project.org/web/packages/ggplot2/index.html.
(Hint: your data should be a factor.)
On September 20,
Hello List,
I submitted the code below, it will show two groups of avg_time bar chart for
each gc_label.
ggplot(s8_GCtime, aes(fill=GTresult, y=avg_time, x=gc_label, label = avg_time))
+
geom_bar(position=position_dodge(), stat="identity") +
geom_text(aes(label=avg_time), vjust=1.6, positi
Sigh. Don't do this. Setup your data frame with all the data you want to plot
and give it to one geom. Use group columns such as factors (e.g. color, size,
linetype, etc) to distinguish them.
Using multiple geoms with different mappings is usually a recipe for
disappointment. It also fails to c
On Fri, 23 Apr 2021 at 20:51, Chris Evans wrote:
>
> I may be quite wrong but isn't the for loop in the second example simply
overwriting/replacing the first p2 with the second whereas the p1 version
is adding the paths to p1.
>
> (If you see what I mean, I don't think I have expressed that very w
On Fri, 23 Apr 2021 at 20:11, Martin Møller Skarbiniks Pedersen <
traxpla...@gmail.com> wrote:
>
> Hi,
>
> I have some problems understanding how to use geom_path() inside a loop.
> I know the code below is a bit silly but it is just a MRE
> ( https://stackoverflow.com/help/minimal-reproducible-exa
Hi,
I have some problems understanding how to use geom_path() inside a loop.
I know the code below is a bit silly but it is just a MRE
( https://stackoverflow.com/help/minimal-reproducible-example )
p1 looks like I expect however p2 only contains the last square. I
expected p2 to be the same as p
That works with my suggestion:
g <-
ggplot() +
theme(
plot.background = element_rect(fill = "yellow2", colour = "yellow2"),
panel.background = element_rect(fill = "yellow2"),
)
g <- g + coord_fixed()
dev.new(bg = "yellow2")
g # For a pure yellow plot window
Duncan Murdoch
On 20
Hello,
Is it this?
plot.background = element_rect(colour = "yellow2", fill = "yellow2")
The small white space goes away.
Hope this helps,
Rui Barradas
Às 17:00 de 20/12/20, Martin Møller Skarbiniks Pedersen escreveu:
On Sun, 20 Dec 2020 at 17:43, Rui Barradas wrote:
Thank you for trying t
On 20/12/2020 12:00 p.m., Martin Møller Skarbiniks Pedersen wrote:
On Sun, 20 Dec 2020 at 17:43, Rui Barradas wrote:
Thank you for trying to answer my question.
I am not sure I understand the problem.
With coord_fixed() both axis have the same length and the plot is a
square. When resizing th
Perhaps ?expansion can help?
On December 20, 2020 9:00:09 AM PST, "Martin Møller Skarbiniks Pedersen"
wrote:
>On Sun, 20 Dec 2020 at 17:43, Rui Barradas
>wrote:
>
>Thank you for trying to answer my question.
>
>> I am not sure I understand the problem.
>> With coord_fixed() both axis have the s
On Sun, 20 Dec 2020 at 17:43, Rui Barradas wrote:
Thank you for trying to answer my question.
> I am not sure I understand the problem.
> With coord_fixed() both axis have the same length and the plot is a
> square. When resizing the plot window the white areas can be on
> top/bottom if the wind
Hello,
I am not sure I understand the problem.
With coord_fixed() both axis have the same length and the plot is a
square. When resizing the plot window the white areas can be on
top/bottom if the window height is bigger than its width or to the
left/right if it's the other way around.
Does
Hi,
I posted this on the Google Group for ggplot2 but got no response.
https://groups.google.com/g/ggplot2/c/441srnt6RZU
So I hope someone can help me here instead?!
-
If I don't use the coord_fixed() then all the background is yellow as
expected.
But I need to coord_fixed() and then it adds a
David,
Great suggestion!
Thanks,
Brian
On Dec 13, 2020, at 6:06 PM, David Winsemius
mailto:dwinsem...@comcast.net>> wrote:
On 12/13/20 12:49 PM, Brian Beckage wrote:
As an example to illustrate my question, if I used the following code to plot
the price of Apple stock using the tidyquan
On 12/13/2020 12:49 PM, Brian Beckage wrote:
As an example to illustrate my question, if I used the following code to plot
the price of Apple stock using the tidyquant package and ggplot2
AAPL<-tq_get(x="AAPL")
AAPL %>%
ggplot(aes(x = date, y = close)) +
geom_line() +
labs(title = "A
On 12/13/20 12:49 PM, Brian Beckage wrote:
As an example to illustrate my question, if I used the following code to plot
the price of Apple stock using the tidyquant package and ggplot2
AAPL<-tq_get(x="AAPL")
AAPL %>%
ggplot(aes(x = date, y = close)) +
geom_line() +
labs(title = "A
As an example to illustrate my question, if I used the following code to plot
the price of Apple stock using the tidyquant package and ggplot2
AAPL<-tq_get(x="AAPL")
AAPL %>%
ggplot(aes(x = date, y = close)) +
geom_line() +
labs(title = "AAPL", y = "Closing Price", x = "") +
coord_x_dat
On 11/11/20 2:11 PM, Marcelo Laia wrote:
Hi,
I am running these approaches:
Model 1
ggplot( dat , aes(x=DAP, y=Altura, color=as.factor(Espacamento) )) +
geom_point(size=0.5) +
stat_smooth(method = "lm",
formula = y ~ x + I(x^2), size = 1) +
facet_grid(Espacame
Hi Rui,
You are very welcome!
On 11/11/20 at 11:10, Rui Barradas wrote:
>
> dput(head(dat, 20))
>
structure(list(Bloco = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), Espacamento = c("3 x 1",
"3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1",
Hello,
Try removing I() from I(log(y)). But it's hard to say without a
reproducible example, please post the output of
dput(dat)
or, if dat is big, the output of
dput(head(dat, 20))
Hope this helps,
Rui Barradas
Às 22:11 de 11/11/20, Marcelo Laia escreveu:
Hi,
I am running these approa
Hi,
I am running these approaches:
Model 1
ggplot( dat , aes(x=DAP, y=Altura, color=as.factor(Espacamento) )) +
geom_point(size=0.5) +
stat_smooth(method = "lm",
formula = y ~ x + I(x^2), size = 1) +
facet_grid(Espacamento ~ Clone) +
theme(legend.position="none")
Many thanks. That solved the problem.
On 08/17/2020 01:49 AM, Rui Barradas wrote:
Hello,
This type of problem is almost always a data reshaping problem.
ggplot graphics work better if the data is in the long format and you
have 3 columns for counts, one column for each category. If you
reform
Hello,
Sorry, I forgot you also want the line type changed.
Remove color and linetype from the initial call to ggplot and include
aes(color = cases, linetype = cases) in geom_line. Then add a layer
scale_linetype_manual with the same name and labels to merge it with the
color legend.
dfO %
Hello,
This type of problem is almost always a data reshaping problem.
ggplot graphics work better if the data is in the long format and you
have 3 columns for counts, one column for each category. If you reformat
from the current wide format to the long format you will have a date
vector, a c
I have cobbled together a short script to plot Covid-19 data.
setwd("~/Apps/Models/1-CoronaVirus")
library(tidyverse)
library(lubridate)
datO <- read.csv("https://api.covidtracking.com/v1/states/oh/daily.csv";)
datO[ ,1] <- ymd(datO[ ,1])
dfO <- tibble::as_tibble(data.frame(datO[ ,"date"],datO
Hello,
I cannot reproduce this. If I do
db <- iris[3:5]
names(db) <- c("length", "width", "support")
and change 'lenght' to 'length' in the ggplot call both axis are plotted.
But the code is not reproducible, db is missing. Can you post the output of
dput(head(db, 30))
in a next mail?
Hope
Dear users,
Does anyone had a problem with ggplot concerning the axis not being
shown? (see attachment)
ggplot(db, aes (x = lenght, y = width, color = support)) +
geom_point(size=2) +
stat_ellipse() +
labs(x="Lenght (mm)", y="width (mm)", title="Boxplot", color = "Support")
I'm using the
Thanks Rui for these 2 possibilities; I'll have a look.
Any one with pointers for the error bars issue?
Ivan
--
Dr. Ivan Calandra
TraCEr, laboratory for Traceology and Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567
Hello,
As for convex hulls, there is an example of how to construct a stat_hull in
vignette("extending-ggplot2", package = "ggplot2")
There is also a geom_hull in a GitHub package:
devtools::install_github("cmartin/ggConvexHull")
Hope this helps,
Rui Barradas
Às 17:02 de 21/04/20, Ivan Cal
Dear useRs,
I would like to have horizontal and vertical error bars extending from
the means on two continuous variables.
This would be the "manual" way of doing it, computing the mean and sd
(or whatever stats) beforehand and then calling geom_errorbar() and
geom_errorbarh() with appropriate coo
> On Aug 11, 2019, at 9:13 AM, Troels Ring wrote:
>
> Dear friends - I have 2 problems with ggplot2
>
> Here is the code for illustration
>
>
>
> x <- seq(1,10,length=1)
>
> y <- x^2
>
> fill <- rep(0,length(x))
>
> fill[(5
> ddf <- data.frame(x,y,fill)
>
> ggplot(data=ddf,aes(x=x
Hello,
You must put the NA in scale_fill_manual. Like this:
ggplot(data = ddf, aes(x = x, y = y)) +
geom_area(aes(fill = fill)) +
geom_line() +
scale_fill_manual(values = c(NA, "red"))
Note also that 'fill' is a factor, were it numeric you would need fill =
factor(fill).
ddf2 <- data
Dear friends - I have 2 problems with ggplot2
Here is the code for illustration
x <- seq(1,10,length=1)
y <- x^2
fill <- rep(0,length(x))
fill[(5https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide comment
Dear Community,I made a Stackoverflow post that I really could use some
professional help here (or the issue is just something really really simple
:D)https://stackoverflow.com/questions/57029118/ggplot2-plots-results-are-different-within-and-outside-of-loop-bug";>ggplot2
plots/results are diffe
Thanks!
-Roy
> On Jul 3, 2018, at 2:40 PM, William Dunlap wrote:
>
> One way to test the new ggplot2 is to make a new directory to use as an R
> library and to install the new ggplot2 there.
>newLibrary <- "C:/tmp/newRLibrary"
>dir.create(newLibrary)
>install.packages("ggplot2", l
One way to test the new ggplot2 is to make a new directory to use as an R
library and to install the new ggplot2 there.
newLibrary <- "C:/tmp/newRLibrary"
dir.create(newLibrary)
install.packages("ggplot2", lib=newLibrary)
Then you can run two R sessions at once, starting one with
.libPa
Hi All:
When I ask about updating packages in my R distribution, it lists ggplot2
version 3.0.0 as being available. I know that ggplot2 version 3.0.0 has made
some significant changes that will break certain things. I would like to
install the new version, to see if it breaks anything that I
Hi,
I posted this on StackOverflow also but did not get a response so I thought
that I would also try luck here. The post is at:
https://stackoverflow.com/questions/49120060/ggplot2-display-blocks-of-nested-split-violins
Basically, I have the following test example:
--cut-and-paste-from-here-on
Hello all,
Zeki(?) reported:
> ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line()
> Error: Found object is not a stat.
Using R v3.4.62 and R studio, I'm unable to reproduce this error.
All the best,
Thomas Subia
[[alternative HTML version deleted]]
On 22 October 2017 at 17:56, Jacques Ropers wrote:
>
> Hi all,
>
> I can't fathom why the accented "é" in the following ggplot2 graph makes
> R hangs when using tikzdevice, whereas it works using simple pdf device.
>
[...]
I just tried your code and my R doesn't hang but it does give an TeX-erro
Hi all,
I can't fathom why the accented "é" in the following ggplot2 graph makes
R hangs when using tikzdevice, whereas it works using simple pdf device.
##
library(tikzDevice)
library(ggplot2)
options(tikzDefaultEngine = "luatex")
tikzLualatexPackages =c(
"\\usepackage{tikz}\n",
"
In the general case it is not possible to do as you ask because "Lab" can be
duplicated. However, in your specific case it is unique in your data frame, so
you just have to control the order of the factor labels instead of letting them
be set up in the default manner. Of course, you have to be a
The order the bars are plotted in is determined by the levels in a factor, and
your labels are treated as a factor. You can make sure you keep the order of
your labels by simply doing this:
Lab <- factor(Lab, levels = Lab)
before constructing the data frame.
Cheers
On 27 Jun 2017, 20.43 +0200
Thanks Jean, that worked!
On Tue, Jun 27, 2017 at 3:58 PM, Adams, Jean wrote:
> You just have to change the levels of the factor ...
>
> library(ggplot2)
>
> Lab = c(letters[4:6], letters[1:3])
> valuex = c(3.1,2.3,0.4,-0.4,-1.2,-4.4)
> df <- data.frame(Lab,valuex)
>
> # set the factor levels to
Hi,
I was trying to make a horizontal bar plot. The barplot works when the text
labels are of reasonable length, but not if some of them are slightly long.
I think the long ones get 'squeezed' by default before the plot is flipped
and keep the skew after the flip. Is there a way I can get around t
You just have to change the levels of the factor ...
library(ggplot2)
Lab = c(letters[4:6], letters[1:3])
valuex = c(3.1,2.3,0.4,-0.4,-1.2,-4.4)
df <- data.frame(Lab,valuex)
# set the factor levels to the same order as observed in the data frame
df$Lab <- factor(df$Lab, levels=unique(df$Lab))
p
Hi,
I was trying to draw a geom_bar plot. However, by default, the bars are
arranged according to the label, which I don't want. I want the bars to
appear exactly as they appear in the data frame. For example in the code:
Lab=c(letters[4:6],letters[1:3])
valuex = c(3.1,2.3,0.4,-0.4,-1.2,-4.4)
Hi All,
I have the following code:
-- cut
(g03_02_p02 <- ggplot(data = d_kzb_input) +
geom_bar(
mapping = aes(x = v03_02_r01, y = round(..prop.. * 100, 0)),
fill = c_ww_palette["blue"]) +
scale_y_continuous(limits = c(0, c_y_limit)) +
theme_classic() +
ggtitle(paste0("Question 3
le_fill_manual(values=c("black","white")) +
scale_color_manual(values=c("black","black"))+
geom_point(shape=21,size=4)
Cheers
Petr
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Santosh
Sent: Wednesday, April
1 - 100 of 989 matches
Mail list logo