ipeagit / aopdata Goto Github PK
View Code? Open in Web Editor NEWDownload data from the Access to Opportunities Project (AOP)
Home Page: https://ipeagit.github.io/aopdata/
Download data from the Access to Opportunities Project (AOP)
Home Page: https://ipeagit.github.io/aopdata/
It could be a good idea to include a function that loads the data dictionary into a data.frame
or an htlm
page.
Include
I'm trying to install the package from GitHub, but the following message appears:
> devtools::install_github("ipeaGIT/aopdata")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo ipeaGIT/aopdata@HEAD
Error: Failed to install 'aopdata' from GitHub:
Does not appear to be an R package (no DESCRIPTION)
a <- read_access(city = c('Fortaleza', 'Recife'), mode = 'public_transport', year = 2019)
table(a$abbrev_muni)
table(a$mode)
b <- read_access(city = c('for', 'rec'), mode = 'public_transport', year = 2019)
table(b$abbrev_muni)
table(b$mode)
Add peak
as a Logical
parameter to the read_access()
function. Defaults to TRUE
. This parameter is only relevant when mode = public_transport
.
for the same reason as geobr.
Vignettes are throwing this error on both macOS-latest (oldrel) and ubuntu-20.04 (release).
- creating vignettes ... ERROR
Error: --- re-building ‘access_inequality.Rmd’ using rmarkdown
Quitting from lines 26-31 (access_inequality.Rmd)
Error: Error: processing vignette 'access_inequality.Rmd' failed with diagnostics:
package or namespace load failed for 'sf' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called 'units'
--- failed re-building ‘access_inequality.Rmd’--- re-building ‘access_maps.Rmd’ using rmarkdown
Quitting from lines 27-31 (access_maps.Rmd)
Error: Error: processing vignette 'access_maps.Rmd' failed with diagnostics:
package or namespace load failed for 'sf' in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called 'units'
--- failed re-building ‘access_maps.Rmd’
I just got this from the CRAN team:
Dear maintainer,
Please see the problems shown on
https://cran.r-project.org/web/checks/check_results_aopdata.html.Please correct before 2021-04-12 to safely retain your package on CRAN.
It seems we need to remind you of the CRAN policy:
'Packages which use Internet resources should fail gracefully with an informative message
if the resource is not available or has changed (and not give a check warning nor error).'This needs correction whether or not the resource recovers.
The CRAN Team
and a secont message from them:
I have seen several different failures in the last few days:
--- re-building ‘access_maps.Rmd’ using rmarkdown
Linking to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.2
Quitting from lines 36-43 (access_maps.Rmd)
Error: processing vignette 'access_maps.Rmd' failed with diagnostics:
object 'type' not found
--- failed re-building ‘access_maps.Rmd’--- re-building ‘landuse_maps.Rmd’ using rmarkdown
Linking to GEOS 3.8.1, GDAL 3.0.4, PROJ 6.3.2
Quitting from lines 35-42 (landuse_maps.Rmd)
Error: processing vignette 'landuse_maps.Rmd' failed with diagnostics:
Cannot open "/tmp/RtmprkkzTh/working_dir/RtmpKy82ey/hex_grid_for.gpkg";
The source could be corrupt or not supported. Seest_drivers()
for a
list of supported formats.
--- failed re-building ‘landuse_maps.Rmd’--- re-building ‘access_maps.Rmd’ using rmarkdown
Linking to GEOS 3.9.0, GDAL 3.2.1, PROJ 6.3.2
Using year 2019
Using mode public_transport
Quitting from lines 36-43 (access_maps.Rmd)
Error: processing vignette 'access_maps.Rmd' failed with diagnostics:
Timeout was reached: [www.ipea.gov.br] Connection timed out after 10013
milliseconds
--- failed re-building ‘access_maps.Rmd’And that website currently also has
Check: whether package can be installed
Result: WARN
Found the following significant warnings:
Warning: unable to re-encode 'utils.R' line 334(checking in Latin-1) and
--- re-building ‘landuse_maps.Rmd’ using rmarkdown Linking to GEOS 3.9.0, GDAL 3.2.1, PROJ 7.2.1 Quitting from lines 35-42 (landuse_maps.Rmd) Error: processing vignette 'landuse_maps.Rmd' failed with diagnostics: some columns are not in the data.table:
abbrev_muni,name_muni,code_muni,id_hex
--- failed re-building ‘landuse_maps.Rmd’--- re-building ‘landuse_maps.Rmd’ using rmarkdown
Warning in engine$weave(file, quiet = quiet, encoding = enc) :
Pandoc (>= 1.12.3) and/or pandoc-citeproc not available. Falling
back to R Markdown v1.
Linking to GEOS 3.6.4, GDAL 2.2.4, PROJ 5.2.0
Quitting from lines 35-42 (landuse_maps.Rmd)
Error: processing vignette 'landuse_maps.Rmd' failed with diagnostics:
Timeout was reached: [www.ipea.gov.br] Operation timed out after
10140 milliseconds with 0 out of 0 bytes received
--- failed re-building ‘landuse_maps.Rmd’--
Brian D. Ripley,
This again:
'Packages which use Internet resources should fail gracefully with an informative message
if the resource is not available or has changed (and not give a check warning nor error).'
@dhersz , could you pleave have a look into this? No hurry.
The function rm_accent()
currently throws this WARNING with CMD Check:
checking R files for non-ASCII characters ... WARNING
Found the following file with non-ASCII characters:
utils.R
Portable packages must use only ASCII characters in their R code,
except perhaps in comments.
Use \uxxxx escapes for other characters.
Right now, the behavior when trying to download accessibility by public transport for all cities returns an error:
# download data
aop_data <- aopdata::read_access(city = "all", mode = "public_transport", year = 2019, geometry = TRUE)
`Using mode public_transport
Downloading accessibility data for the year 2019
|======================================================================================================| 100%
Error in aopdata::read_access(city = "all", mode = "public_transport", :
One of the selected cities does not have public transport data for that year.`
I think it would be nice to pre-filter only cities with public transport for that year and return the accessibility estimates for them, instead of returning an error.
A message indicating the cities would be nice as well.
The landuse database (from read_landuse
) is coming duplicated when the chosen year is 2017 or 2018:
> landuse_2017 <- aopdata::read_landuse(city = c("for"),
year = 2017,
geometry = FALSE)
> table(landuse_2017$year)
2017 2019
2562 2562
Also, all the population observations from 2017 or 2018 are NA for that year:
> a <- landuse_2017[year == 2017]
> summary(a$P001)
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
NA NA NA NaN NA NA 2562
The issue may be here, where the year
column from the aop_population
dataset is always equal to 2019. When merging the two datasets with all = TRUE
and year = 2017|2018
from the landuse, the two datasets are rbinded.
aopdata/r-package/R/read_landuse.R
Line 127 in e564f09
The spatial grid downloaded by the function aopdata::read_grid
currently contains duplicates of some hexagons. All cities seem to have this issue at the moment.
Two issues raised by CRAM:
Also, 'Writing R Extensions' asks you not to use progress bars in non-interactive use such as R CMD check.
'Packages which use Internet resources should fail gracefully with an informative message if the resource is not available or has changed (and not give a check warning nor error).'
We got the following message from CRAN:
Version: 0.2.0
Check: whether package can be installed
Result: WARN
Found the following significant warnings:
Warning: unable to re-encode 'utils.R' line 382
Flavor: r-devel-linux-x86_64-debian-clang
I'm replacing the rm_accent()
function with a simple base::iconv(city, to="ASCII//TRANSLIT")
The reason for this is beacause they como from different years.
I've been downloading the data through the read_access
function and I saw three enhancements that could be made.
The first is the need to mention the cities code in the read_access
, read_population
, read_grid
, and read_landuse
documentation. I could only find the codes when I downloaded using city = all
.
Also, the function could be implemented to accept a vector of cities' names, instead of a single city. By doing this the user doesn't need to use any lapply()
command to extract the desired files.
When we use mode = 'public_transport'
with city = 'all'
, we get this error:
> a <- aopdata::read_access(city = 'all', mode = 'public_transport',
peak = TRUE, year = 2019, geometry = TRUE)
Using mode public_transport
Downloading accessibility data from year 2019
|=====================================================| 100%
Error in aopdata::read_access(city = "all", mode = "public_transport", :
One of the selected cities does not have public transport data for that year.
There could be a condition that uses c("for", "rec", "bho","rio", "spo", "cur", "poa")
when the commands (mode = 'public_transport'
with city = 'all'
) are used together.
If you guys agree with these suggestions, I can go forward and open a PR.
df_car <- read_access(
city='Curitiba',
mode='car',
year=2019,
peak = F,
geometry = TRUE,
showProgress = FALSE
)
table(df_car$peak)
> 1
> 4369
updata data dictionary in the documentation of each function to reflect the new data set
Guys, I need some help here. This is the message I got today:
Dear maintainer,
package aopdata_0.2.2.tar.gz has been auto-processed.
The auto-check found additional issues for the last version released on CRAN:
M1mac https://www.stats.ox.ac.uk/pub/bdr/M1mac/aopdata.out
CRAN incoming checks do not test for these additional issues and you will need an appropriately instrumented build of R to reproduce these.
Hence please reply-all and explain: Have these been fixed?Log dir: https://win-builder.r-project.org/incoming_pretest/aopdata_0.2.2_20210423_192923/
The files will be removed after roughly 7 days.
Installation time in seconds: 5
Check time in seconds: 98
R version 4.1.0 alpha (2021-04-22 r80209)Pretests results:
Windows: https://win-builder.r-project.org/incoming_pretest/aopdata_0.2.2_20210423_192923/Windows/00check.log
Status: OK
Debian: https://win-builder.r-project.org/incoming_pretest/aopdata_0.2.2_20210423_192923/Debian/00check.log
Status: OKLast released version's CRAN status: ERROR: 3, WARN: 2, OK: 8
See: https://CRAN.R-project.org/web/checks/check_results_aopdata.htmlLast released version's additional issues:
M1mac https://www.stats.ox.ac.uk/pub/bdr/M1mac/aopdata.outCRAN Web: https://cran.r-project.org/package=aopdata
No strong reverse dependencies to be checked.
Best regards,
CRAN teams' auto-check service
Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-ix86+x86_64
Check: CRAN incoming feasibility, Result: Note_to_CRAN_maintainers
Maintainer: 'Rafael H. M. Pereira [email protected]'
It seems the access
data stored in the server only includes off-peak.
Error message could be more specific about the availability of access estimates by car
df_car <- read_access(
city='Curitiba',
mode='car',
year=2018,
peak = F,
geometry = TRUE,
showProgress = FALSE
)
Error in select_mode_input(temp_meta, mode = m) :
Error: This 'mode' is not available for this 'city' & 'year.' It must be one of the following: bicycle public_transport walk
It doesn't make sense to default to any city, IMO.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.