Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #53

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ To help you get started, ggswim includes three sample datasets: `patient_data`,

ggswim offers several geom-functions, and by using `geom_swim_lane()` we can set up the horizontal response paths of our swimmer plot, i.e. the "lanes". We'll also set up corresponding arrows to indicate subjects that are still on the trial:

```{r, include=FALSE}
```{r, message=FALSE}
library(ggswim)
library(ggplot2)

# Construct arrow_data for arrow display later
arrow_data <- patient_data |>
dplyr::left_join(
end_study_events |>
Expand All @@ -53,11 +56,6 @@ arrow_data <- patient_data |>
dplyr::select(pt_id, end_time, end_study_name) |>
dplyr::filter(.by = pt_id, end_time == max(end_time)) |>
unique()
```

```{r, message=FALSE}
library(ggswim)
library(ggplot2)

p <- patient_data |>
ggplot() +
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ that are still on the trial:
library(ggswim)
library(ggplot2)

# Construct arrow_data for arrow display later
arrow_data <- patient_data |>
dplyr::left_join(
end_study_events |>
dplyr::select(pt_id, end_study_name),
by = "pt_id"
) |>
dplyr::select(pt_id, end_time, end_study_name) |>
dplyr::filter(.by = pt_id, end_time == max(end_time)) |>
unique()

p <- patient_data |>
ggplot() +
geom_swim_lane(
Expand All @@ -66,7 +77,7 @@ p <- patient_data |>
p
```

<img src="man/figures/README-unnamed-chunk-3-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-2-1.png" width="100%" />

Next we’ll add on events of interest: end of study updates and
infusions. We’ll refer to these as “markers” and call them with two more
Expand All @@ -89,7 +100,7 @@ p <- p +
p
```

<img src="man/figures/README-unnamed-chunk-4-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-3-1.png" width="100%" />

Finally, we’ll beautify the plot with familiar ggplot2 techniques and a
last finishing touch with `theme_ggswim()`:
Expand All @@ -102,7 +113,7 @@ p +
theme_ggswim()
```

<img src="man/figures/README-unnamed-chunk-5-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-4-1.png" width="100%" />

## Collaboration

Expand Down
Binary file modified man/figures/README-unnamed-chunk-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading