How can I add x and y axis labels in ggplot2 ?

0 votes
May 16, 2018 in Data Analytics by shams
• 3,580 points
86 views

1 answer to this question.

0 votes
# Load a dataset(to work with)
# We’ll also quickly plot the data to display the data visually, prior to formatting.

df.ch<- read.csv(url("something.txt"))
ggplot(data=df.ch, aes(x=year,y=co2_emission_per_cap_qt)) + geom_line()

# By default, ggplot() uses variable names as the axis titles.
answered May 16, 2018 by zombie
• 3,690 points

Related Questions In Data Analytics

0 votes
0 answers
0 votes
1 answer

How can I pause, sleep, wait, execution for X seconds in R?

You can try the following piece of ...READ MORE

answered May 25, 2018 in Data Analytics by zombie
• 3,690 points
84 views
0 votes
2 answers

How can I add YAML current date in rmarkdown ?

<$today:MM/dd/yyyy> READ MORE

answered Mar 25 in Data Analytics by Anupam Das
1,167 views
0 votes
1 answer

How can I increase the number of axis ticks in R ?

You can try to override ggplots default ...READ MORE

answered May 30, 2018 in Data Analytics by zombie
• 3,690 points
163 views
0 votes
1 answer
0 votes
1 answer

How to change y axis max in time series using R?

The axis limits are being set using ...READ MORE

answered Apr 3, 2018 in Data Analytics by darklord
• 6,140 points
69 views
0 votes
1 answer

How can I drop columns by name in a data frame ?

We can Drop Columns by name in ...READ MORE

answered Apr 13, 2018 in Data Analytics by zombie
• 3,690 points
29 views
0 votes
1 answer

Which function can I use to clear the console in R and RStudio ?

Description                   Windows & Linux           Mac Clear console                      Ctrl+L ...READ MORE

answered Apr 17, 2018 in Data Analytics by anonymous
909 views
0 votes
1 answer

How can I rotate axis labels in R ?

library(ggplot2) p <- data.frame(Day=c("2011-04-11", "2014-05-24","2004-01-12","2014-06-20","2010-08-07","2014-05-28"), Impressions=c(24010,15959,16107,21792,24933,21634),Clicks=c(211,106,248,196,160,241)) p       ...READ MORE

answered May 18, 2018 in Data Analytics by zombie
• 3,690 points
177 views
0 votes
1 answer

How can I change font size and direction of axes text in ggplot2 ?

You can try theme(): Library(ggplot2) a <- data.frame(x=gl(10, 1, ...READ MORE

answered May 30, 2018 in Data Analytics by zombie
• 3,690 points
170 views