Skip to content

Commit f9a5c89

Browse files
authored
Remove more vestigial R checking code (#1213)
1 parent 929a533 commit f9a5c89

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pak::pak("tidyverse/purrr")
4646

4747
The following example uses purrr to solve a fairly realistic problem: split a data frame into pieces, fit a model to each piece, compute the summary, then extract the R^2^.
4848

49-
```{r, eval = getRversion() >= "4.1"}
49+
```{r}
5050
library(purrr)
5151
5252
mtcars |>

vignettes/base.Rmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ knitr::opts_chunk$set(
1616
fig.align = "center"
1717
)
1818
options(tibble.print_min = 6, tibble.print_max = 6)
19-
20-
modern_r <- getRversion() >= "4.1.0"
2119
```
2220

2321
# Introduction
@@ -172,7 +170,7 @@ sds <- 1:4
172170
173171
In R 4.1 and up, you could use the shorter anonymous function form:
174172
175-
```{r, eval = modern_r}
173+
```{r}
176174
samples <- Map(\(...) rnorm(..., n = 5), mean = means, sd = sds)
177175
```
178176
@@ -269,7 +267,7 @@ means |>
269267
The pipe is particularly compelling when working with longer transformations.
270268
For example, the following code splits `mtcars` up by `cyl`, fits a linear model, extracts the coefficients, and extracts the first one (the intercept).
271269

272-
```{r, eval = modern_r}
270+
```{r}
273271
mtcars |>
274272
split(mtcars$cyl) |>
275273
map(\(df) lm(mpg ~ wt, data = df))|>

0 commit comments

Comments
 (0)