Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R_basis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CAN
R_basis
Commits
8a0327ac
Commit
8a0327ac
authored
Mar 25, 2020
by
hpolvech
Browse files
Options
Downloads
Patches
Plain Diff
session3: remove last Callenge
parent
00f81181
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
session_3/HTML_tuto_s3.Rmd
+17
-74
17 additions, 74 deletions
session_3/HTML_tuto_s3.Rmd
with
17 additions
and
74 deletions
session_3/HTML_tuto_s3.Rmd
+
17
−
74
View file @
8a0327ac
...
@@ -263,93 +263,36 @@ ggplot(data = diamonds, mapping = aes(x = cut, y = depth, color = clarity)) +
...
@@ -263,93 +263,36 @@ ggplot(data = diamonds, mapping = aes(x = cut, y = depth, color = clarity)) +
```
```
```{r dia_12, cache = TRUE, fig.width=8, fig.height=4.5, message=FALSE}
```{r diamonds_bar, cache = TRUE, fig.width=8, fig.height=4.5, message=FALSE}
ggplot(data = diamonds, mapping = aes(x = depth, y = table)) +
bar <- ggplot(data = diamonds) +
geom_point() +
geom_bar(
geom_abline()
mapping = aes(x = cut, fill = cut),
show.legend = FALSE,
width = 1
) +
theme(aspect.ratio = 1) +
labs(x = NULL, y = NULL)
```
**3_d**
```{r diamonds_bar_plot, echo=F, cache = TRUE, fig.width=8, fig.height=4.5, message=FALSE}
bar
```
**3_d**
```{r diamonds_bar_flip, cache = TRUE, fig.width=8, fig.height=4.5, message=FALSE}
bar + coord_flip()
```
```{r mpg_jitter_noquickmap, cache = TRUE, fig.width=8, fig.height=4.5, message=FALSE}
ggplot(data = mpg) +
geom_jitter(mapping = aes(x = cty, y = hwy))
```
```
```{r dia_quickmap, cache = TRUE, fig.width=8, fig.height=4.5, message=FALSE}
```{r mpg_jitter_quickmap, cache = TRUE, fig.width=3.5, fig.height=3.5, message=FALSE}
ggplot(data = diamonds, mapping = aes(x = depth, y = table)) +
ggplot(data = mpg
) +
geom_point(
) +
geom_
jitter(mapping = aes(x = cty, y = hwy)
) +
geom_
abline(
) +
coord_quickmap()
coord_quickmap()
```
```
```{r mpg_jitter_log, cache = TRUE, fig.width=8.5, fig.height=3.5, message=FALSE}
ggplot(data = mpg) +
geom_jitter(mapping = aes(x = cty, y = hwy)) +
scale_y_log10() +
scale_x_log10()
```
```{r diamonds_bar_polar, cache = TRUE, fig.width=5, fig.height=3.5, message=FALSE}
bar + coord_polar()
```
## Coordinate systems challenges
- Turn a stacked bar chart into a pie chart using `coord_polar()`.
```{r diamonds_bar, cache = TRUE, fig.width=8, fig.height=4.5, message=FALSE}
- What does `labs()` do? Read the documentation.
bar <- ggplot(data = diamonds, mapping = aes(x = cut, fill = cut)) +
- What does the plot below tell you about the relationship between `city` and highway `mpg`? Why is `coord_fixed()` important? What does `geom_abline()` do?
geom_bar( show.legend = FALSE, width = 1 ) +
theme(aspect.ratio = 1) +
```{r mpg_point_fixed, eval = F, cache = TRUE, fig.width=4.5, fig.height=3.5, message=FALSE}
labs(x = NULL, y = NULL)
ggplot(data = mpg, mapping = aes(x = cty, y = hwy)) +
geom_point() +
geom_abline() +
coord_fixed()
```
## Coordinate systems challenges
```{r diamonds_barplot_pos_fill_polar, cache = TRUE, fig.width=8, fig.height=4.5, message=FALSE}
bar
ggplot(data = diamonds) +
geom_bar(mapping = aes(x = cut, fill = clarity),
position = "fill") +
coord_polar()
```
```
## Coordinate systems challenges
```{r mpg_point_nofixed_plot, eval = T, cache = TRUE, fig.width=8, fig.height=3.5, message=FALSE}
```{r diamonds_bar_polar, cache = TRUE, fig.width=8, fig.height=4.5, message=FALSE}
ggplot(data = mpg, mapping = aes(x = cty, y = hwy)) +
bar + coord_polar()
geom_point() + geom_abline()
```
```
## Coordinate systems challenges
```{r mpg_point_fixed_plot, eval = T, cache = TRUE, fig.width=8, fig.height=3.5, message=FALSE}
##See you to Session#4 : ""
ggplot(data = mpg, mapping = aes(x = cty, y = hwy)) +
\ No newline at end of file
geom_point() + geom_abline() + coord_fixed()
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment