Skip to content

Commit

Permalink
better readme example code spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
cole-brokamp committed Jul 5, 2024
1 parent b21f20e commit 725cfdb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
6 changes: 4 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ library(PurpleAir)
Get the latest data from a single PurpleAir sensor, defined by its [sensor key](https://community.purpleair.com/t/sensor-index/4000):

```{r}
get_sensor_data(sensor_index = 175413, fields = c("name", "last_seen", "pm2.5_cf_1", "pm2.5_atm"))
get_sensor_data(sensor_index = 175413,
fields = c("name", "last_seen", "pm2.5_cf_1", "pm2.5_atm"))
```

Get the latest data from many PurpleAir sensors, defined by their sensor keys,

```{r}
get_sensors_data(x = as.integer(c(175257, 175413)), fields = c("name", "last_seen", "pm2.5_cf_1", "pm2.5_atm"))
get_sensors_data(x = as.integer(c(175257, 175413)),
fields = c("name", "last_seen", "pm2.5_cf_1", "pm2.5_atm"))
```

a geographic bounding box,
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,32 @@ Get the latest data from a single PurpleAir sensor, defined by its
[sensor key](https://community.purpleair.com/t/sensor-index/4000):

``` r
get_sensor_data(sensor_index = 175413, fields = c("name", "last_seen", "pm2.5_cf_1", "pm2.5_atm"))
get_sensor_data(sensor_index = 175413,
fields = c("name", "last_seen", "pm2.5_cf_1", "pm2.5_atm"))
#> $last_seen
#> [1] "2024-07-05 14:09:43 EDT"
#> [1] "2024-07-05 14:11:43 EDT"
#>
#> $name
#> [1] "JN-Clifton,OH"
#>
#> $pm2.5_atm
#> [1] 4.2
#> [1] 3.8
#>
#> $pm2.5_cf_1
#> [1] 4.2
#> [1] 3.8
```

Get the latest data from many PurpleAir sensors, defined by their sensor
keys,

``` r
get_sensors_data(x = as.integer(c(175257, 175413)), fields = c("name", "last_seen", "pm2.5_cf_1", "pm2.5_atm"))
get_sensors_data(x = as.integer(c(175257, 175413)),
fields = c("name", "last_seen", "pm2.5_cf_1", "pm2.5_atm"))
#> # A tibble: 2 × 5
#> sensor_index last_seen name pm2.5_atm pm2.5_cf_1
#> <int> <dttm> <chr> <dbl> <dbl>
#> 1 175257 2024-07-05 14:10:00 Lillard 3.7 3.7
#> 2 175413 2024-07-05 14:09:43 JN-Clifton,OH 4.2 4.2
#> 1 175257 2024-07-05 14:12:00 Lillard 3.7 3.7
#> 2 175413 2024-07-05 14:11:43 JN-Clifton,OH 3.8 3.8
```

a geographic bounding box,
Expand Down

0 comments on commit 725cfdb

Please sign in to comment.