[R] Unable to make plots using ggplot2

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Sun Feb 16 23:08:04 CET 2020


What do you think these two statements do?

df <- data2
df <- data.frame(var=c("Young_Control", "Young_Treated", "CHG_methylation"))

I suggest you stop what you're doing and spend time with an R tutorial or
two before proceeding.

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sun, Feb 16, 2020 at 2:01 PM pooja sinha <pjsinha07 using gmail.com> wrote:

> Hi All,
>
> I have data in excel with the following details:
> CHG_methylation Young_Control Young_Treated
> 0-10% 95.23 94.53
> 10-20% 3.71 4.16
> 20-30% 0.68 0.8
> 30-40% 0.18 0.22
> 40-50% 0.07 0.09
> 50-60% 0.04 0.06
> 60-70% 0.02 0.04
> 70-80% 0.02 0.03
> 80-90% 0.02 0.03
> 90-100% 0.04 0.05
> I am trying to plot the graph using ggplot2 but not successful yet. My code
> is below:
>
> library(readxl)
> library(dplyr)
> library(tidyverse)
> data2 <- read_excel("CHG_meth_plot1.xlsx")
> df <- data2
> df <- data.frame(var=c("Young_Control", "Young_Treated",
> "CHG_methylation"))
> df
>
> ggplot(data = df, aes(x = var, y = CHG_methylation)) +
>   geom_bar(aes(fill = CHG_methylation))
>
> I am getting error as something is wrong with my df. Also I needed to
> create breaks in y-axis as I do not know whether it is possible in R or
> not.
> Any kind of help is highly appreciated.
>
> Thanks,
> Puja
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list