Skip to content

Commit 0296513

Browse files
author
Susan Vanderplas
committed
Remove eval: -1
1 parent b359cf7 commit 0296513

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

part-wrangling/01-data-input.qmd

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,21 @@ These files are fairly common outputs from older FORTRAN-based programs, but may
7676
##### Base R {.unnumbered}
7777

7878
In base R (no extra packages), you can read fixed-width files in using `read.fwf`, but you must specify the column breaks yourself, which can be painful.
79+
```{r}
80+
#| eval: false
81+
#| echo: true
82+
url <- "https://www.mesonet.org/index.php/dataMdfMts/dataController/getFile/202206070000/mdf/TEXT/"
83+
```
84+
```{r}
85+
#| eval: true
86+
#| echo: false
87+
88+
url <- "../data/mesodata.txt"
89+
```
7990

8091
```{r}
8192
#| label: read-fwf-colbreaks
8293
#| error: true
83-
#| eval: -1
84-
#| echo: -2
85-
url <- "https://www.mesonet.org/index.php/dataMdfMts/dataController/getFile/202206070000/mdf/TEXT/"
86-
url <- "../data/mesodata.txt"
8794
data <- read.fwf(url,
8895
skip = 3, # Skip the first 2 lines (useless) + header line
8996
widths = c(5, 6, 6, 7, 7, 7, 7, 6, 7, 7, 7, 8, 9, 6, 7, 7, 7, 7, 7, 7,

part-wrangling/07-datetime.qmd

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ The libraries I've chosen for this are `datetime` in Python (used by Pandas), an
2626

2727
::: panel-tabset
2828
### R
29-
3029
```{r}
31-
#| eval: -1
30+
#| eval: false
31+
#| echo: true
3232
install.packages("lubridate")
33-
library(lubridate)
33+
```
3434

35+
```{r}
36+
library(lubridate)
3537
# get current date/time
3638
today()
3739
now()
@@ -46,6 +48,13 @@ now()
4648
pip install datetime
4749
```
4850

51+
Or, if you prefer IPython magic...
52+
53+
```{python}
54+
#| eval: false
55+
%pip install datetime
56+
```
57+
4958
```{python}
5059
#| eval: true
5160
import datetime

0 commit comments

Comments
 (0)