Skip to content

Commit

Permalink
docs: rebuilt docs for version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathancallahan committed Apr 3, 2023
1 parent e7291ec commit d189b4b
Show file tree
Hide file tree
Showing 142 changed files with 370 additions and 326 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Imports:
lubridate,
magrittr,
MazamaLocationUtils (>= 0.3.8),
MazamaSpatialUtils (>= 0.8.1),
MazamaSpatialUtils (>= 0.7.6),
openair,
PWFSLSmoke (>= 1.2.117),
readr,
Expand All @@ -60,7 +60,8 @@ Suggests:
markdown,
testthat (>= 2.1.0),
rmarkdown,
roxygen2
roxygen2,
sp
Description: Process and display data from air quality sensors.
Initial focus is on PM2.5 measurements from sensors produced by 'PurpleAir'
<https://www2.purpleair.com>.
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Added "Working with PurpleAir API Keys" article.
* When `show_only` is used, spatial bounding information is ignored in:
`pa_getSensorsData()`, `pas_downloadParseRawData()` and `pas_createNew()`.
* Updated `pas_createNew()` to be backwards compatible with **MazamaSpatialUtils**
version 0.7.6.

# AirSensor 1.1.0

Expand Down
86 changes: 63 additions & 23 deletions R/pas_createNew.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ pas_createNew <- function(
if ( length(stateCodes) != 1 ) {
stop("please limit 'stateCodes' to a single state when using 'counties'")
}

}
}

Expand All @@ -151,6 +150,8 @@ pas_createNew <- function(

}

MSU_version <- utils::packageVersion("MazamaSpatialUtils")

# ----- Get country/state bounding box ---------------------------------------

if ( !is.null(show_only) ) {
Expand All @@ -175,46 +176,85 @@ pas_createNew <- function(
isFIPS <- stringr::str_detect(counties[1], "[0-9]{5}")

if ( isFIPS ) {
SFDF <-
get("USCensusCounties") %>% # To pass R CMD check
dplyr::filter(.data$stateCode %in% stateCodes) %>%
dplyr::filter(.data$countyFIPS %in% counties)
} else {

if ( grepl("^0.7", MSU_version) ) {
SPDF <-
get("USCensusCounties") %>%
subset(stateCode %in% stateCodes) %>%
subset(countyFIPS %in% counties)
} else {
SFDF <-
get("USCensusCounties") %>% # To pass R CMD check
dplyr::filter(.data$stateCode %in% stateCodes) %>%
dplyr::filter(.data$countyFIPS %in% counties)
}

} else{

# Handle input inconsistencies
counties <-
stringr::str_to_title(counties) %>%
stringr::str_replace(" County", "")
SFDF <-
get("USCensusCounties") %>% # To pass R CMD check
dplyr::filter(.data$stateCode %in% stateCodes) %>%
dplyr::filter(.data$countyName %in% counties)

if ( grepl("^0.7", MSU_version) ) {
SPDF <-
get("USCensusCounties") %>%
subset(stateCode %in% stateCodes) %>%
subset(countyName %in% counties)
} else {
SFDF <-
get("USCensusCounties") %>% # To pass R CMD check
dplyr::filter(.data$stateCode %in% stateCodes) %>%
dplyr::filter(.data$countyName %in% counties)
}

}

} else {

# Use state but not counties
SFDF <-
get("NaturalEarthAdm1") %>% # To pass R CMD check
dplyr::filter(.data$countryCode %in% countryCodes) %>%
dplyr::filter(.data$stateCode %in% stateCodes)
if ( grepl("^0.7", MSU_version) ) {
SPDF <-
get("NaturalEarthAdm1") %>% # To pass R CMD check
subset(countryCode %in% countryCodes) %>%
subset(stateCode %in% stateCodes)
} else {
SFDF <-
get("NaturalEarthAdm1") %>% # To pass R CMD check
dplyr::filter(.data$countryCode %in% countryCodes) %>%
dplyr::filter(.data$stateCode %in% stateCodes)
}

}

} else {

# Neither state nor county is specified
SFDF <-
MazamaSpatialUtils::SimpleCountriesEEZ %>%
dplyr::filter(.data$countryCode %in% countryCodes)
if ( grepl("^0.7", MSU_version) ) {
SPDF <-
MazamaSpatialUtils::SimpleCountriesEEZ %>%
subset(countryCode %in% countryCodes)
} else {
SFDF <-
MazamaSpatialUtils::SimpleCountriesEEZ %>%
dplyr::filter(.data$countryCode %in% countryCodes)
}

}

bbox <- sf::st_bbox(SFDF)

west <- bbox$xmin
east <- bbox$xmax
south <- bbox$ymin
north <- bbox$ymax
if ( grepl("^0.7", MSU_version) ) {
bbox <- sp::bbox(SPDF)
west <- bbox[1,1]
east <- bbox[1,2]
south <- bbox[2,1]
north <- bbox[2,2]
} else {
bbox <- sf::st_bbox(SFDF)
west <- bbox$xmin
east <- bbox$xmax
south <- bbox$ymin
north <- bbox$ymax
}

}

Expand Down
Binary file modified docker/AirSensor_1.1.1.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/AirSensor_Function_Overview.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Custom_QC_Algorithms.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Developer_Style_Guide.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/Working_with_PurpleAir_API_Keys.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/outlier_detection.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions docs/articles/pas_introduction.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/articles/pat_introduction.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/articles/pat_introduction_files/figure-html/scatterplot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ articles:
outlier_detection: outlier_detection.html
pas_introduction: pas_introduction.html
pat_introduction: pat_introduction.html
last_built: 2023-03-31T22:00Z
last_built: 2023-04-03T00:22Z

2 changes: 1 addition & 1 deletion docs/reference/AIRSENSOR_1_PAT_FIELDS.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/APIKeys.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/AirSensor.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/ArchiveBaseDir.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/ArchiveBaseUrl.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/PurpleAirQC_hourly_AB_00.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/PurpleAirQC_hourly_AB_01.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/PurpleAirQC_hourly_AB_02.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/PurpleAirQC_hourly_AB_03.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified docs/reference/PurpleAirSoH_dailyABFit-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/reference/PurpleAirSoH_dailyABFit.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/PurpleAirSoH_dailyABtTest.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/PurpleAirSoH_dailyMetFit.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d189b4b

Please sign in to comment.