chrisvwn / Rnightlights

R package to extract data from satellite nightlights.
GNU General Public License v3.0
47 stars 14 forks source link

Error while running example #9

Closed davidcomfort closed 6 years ago

davidcomfort commented 6 years ago

Hi, I try running the example code:

highestAdmLevelStats <- getCtryNlData(ctryCode = ctry, 
                                      admLevel = "highest",
                                      nlType = "VIIRS.M", 
                                      nlPeriods = nlRange("201401", "201412"), 
                                      nlStats = "sum",
                                      ignoreMissing=FALSE)

and I keep getting an error:

Invalid nlPeriods:: OLS.Y:201401,
Invalid nlPeriods:: VIIRS.D:201401,
Processing missing data: KEN:VIIRS.M:201401:sum, VIIRS.M:201402:sum, VIIRS.M:201403:sum, VIIRS.M:201404:sum, VIIRS.M:201405:sum, VIIRS.M:201406:sum, VIIRS.M:201407:sum, VIIRS.M:201408:sum, VIIRS.M:201409:sum, VIIRS.M:201410:sum, VIIRS.M:201411:sum, VIIRS.M:201412:sum. This may take a while. 
Note: Set 'ignoreMissing=TRUE' to return only data found or 
'ignoreMissing=NULL' to return NULL if not all the data is found
Downloading country polygons ...
Downloading polygon: KEN
Downloading ctry poly: KEN
Polygon dir for KEN already exists
Saving country admLevel structure to CSV
Error in cbind(ctryCodeCol, ctryNlDataDF, areas) : 
  object 'ctryCodeCol' not found

Here is my output from sessionInfo()

R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] reshape2_1.4.3       lubridate_1.7.4      Rnightlights_0.2.1.1

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.17      raster_2.6-7      magrittr_1.5      maptools_0.9-2    maps_3.3.0        lattice_0.20-35  
 [7] cleangeo_0.2-2    foreach_1.4.4     stringr_1.3.1     plyr_1.8.4        fields_9.6        tools_3.4.4      
[13] dotCall64_0.9-5.2 rgdal_1.3-3       grid_3.4.4        data.table_1.11.4 spam_2.2-0        rgeos_0.3-28     
[19] iterators_1.0.10  settings_0.2.4    codetools_0.2-15  sp_1.3-1          rworldmap_1.3-6   stringi_1.1.7    
[25] compiler_3.4.4    foreign_0.8-70
chrisvwn commented 6 years ago

Hi David,

Sorry about that. I am just fixing up the package after a while and adding a couple of features so the github version is really buggy.

I should have it stabilized in the next few days or so. Please check back maybe in a week?

Regards,

Chris

On Sun, Jul 22, 2018 at 1:10 AM, David Michael Comfort < notifications@github.com> wrote:

Hi, I try running the example code: highestAdmLevelStats <- getCtryNlData(ctryCode = ctry, admLevel = "highest", nlType = "VIIRS.M", nlPeriods = nlRange("201401", "201412"), nlStats = "sum", ignoreMissing=FALSE)

and I keep getting an error: Invalid nlPeriods:: OLS.Y:201401, Invalid nlPeriods:: VIIRS.D:201401, Processing missing data: KEN:VIIRS.M:201401:sum, VIIRS.M:201402:sum, VIIRS.M:201403:sum, VIIRS.M:201404:sum, VIIRS.M:201405:sum, VIIRS.M:201406:sum, VIIRS.M:201407:sum, VIIRS.M:201408:sum, VIIRS.M:201409:sum, VIIRS.M:201410:sum, VIIRS.M:201411:sum, VIIRS.M:201412:sum. This may take a while. Note: Set 'ignoreMissing=TRUE' to return only data found or 'ignoreMissing=NULL' to return NULL if not all the data is found Downloading country polygons ... Downloading polygon: KEN Downloading ctry poly: KEN Polygon dir for KEN already exists Saving country admLevel structure to CSV Error in cbind(ctryCodeCol, ctryNlDataDF, areas) : object 'ctryCodeCol' not found

Here is my output from sessionInfo()

`R version 3.4.4 (2018-03-15) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] reshape2_1.4.3 lubridate_1.7.4 Rnightlights_0.2.1.1

loaded via a namespace (and not attached): [1] Rcpp_0.12.17 raster_2.6-7 magrittr_1.5 maptools_0.9-2 maps_3.3.0 lattice_0.20-35 [7] cleangeo_0.2-2 foreach_1.4.4 stringr_1.3.1 plyr_1.8.4 fields_9.6 tools_3.4.4 [13] dotCall64_0.9-5.2 rgdal_1.3-3 grid_3.4.4 data.table_1.11.4 spam_2.2-0 rgeos_0.3-28 [19] iterators_1.0.10 settings_0.2.4 codetools_0.2-15 sp_1.3-1 rworldmap_1.3-6 stringi_1.1.7 [25] compiler_3.4.4 foreign_0.8-70 `

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chrisvwn/Rnightlights/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AGF4OpcHohy3p-KBFw-Ts61-DIuBLyqiks5uI6brgaJpZM4VZx5e .

chrisvwn commented 6 years ago

Actually, give this another go. I have made some quick fixes and it should work. If not, please try delete the KEN polygon folder so that it is downloaded afresh. Let me know if it still doesn't work.

Chris

On Sun, Jul 22, 2018 at 1:10 AM, David Michael Comfort < notifications@github.com> wrote:

Hi, I try running the example code: highestAdmLevelStats <- getCtryNlData(ctryCode = ctry, admLevel = "highest", nlType = "VIIRS.M", nlPeriods = nlRange("201401", "201412"), nlStats = "sum", ignoreMissing=FALSE)

and I keep getting an error: Invalid nlPeriods:: OLS.Y:201401, Invalid nlPeriods:: VIIRS.D:201401, Processing missing data: KEN:VIIRS.M:201401:sum, VIIRS.M:201402:sum, VIIRS.M:201403:sum, VIIRS.M:201404:sum, VIIRS.M:201405:sum, VIIRS.M:201406:sum, VIIRS.M:201407:sum, VIIRS.M:201408:sum, VIIRS.M:201409:sum, VIIRS.M:201410:sum, VIIRS.M:201411:sum, VIIRS.M:201412:sum. This may take a while. Note: Set 'ignoreMissing=TRUE' to return only data found or 'ignoreMissing=NULL' to return NULL if not all the data is found Downloading country polygons ... Downloading polygon: KEN Downloading ctry poly: KEN Polygon dir for KEN already exists Saving country admLevel structure to CSV Error in cbind(ctryCodeCol, ctryNlDataDF, areas) : object 'ctryCodeCol' not found

Here is my output from sessionInfo()

`R version 3.4.4 (2018-03-15) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] reshape2_1.4.3 lubridate_1.7.4 Rnightlights_0.2.1.1

loaded via a namespace (and not attached): [1] Rcpp_0.12.17 raster_2.6-7 magrittr_1.5 maptools_0.9-2 maps_3.3.0 lattice_0.20-35 [7] cleangeo_0.2-2 foreach_1.4.4 stringr_1.3.1 plyr_1.8.4 fields_9.6 tools_3.4.4 [13] dotCall64_0.9-5.2 rgdal_1.3-3 grid_3.4.4 data.table_1.11.4 spam_2.2-0 rgeos_0.3-28 [19] iterators_1.0.10 settings_0.2.4 codetools_0.2-15 sp_1.3-1 rworldmap_1.3-6 stringi_1.1.7 [25] compiler_3.4.4 foreign_0.8-70 `

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chrisvwn/Rnightlights/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AGF4OpcHohy3p-KBFw-Ts61-DIuBLyqiks5uI6brgaJpZM4VZx5e .

chrisvwn commented 6 years ago

Also, please note Rnightlights version 0.2.2 is out on CRAN. You can give this a go as it should be more stable than the github repo.

chrisvwn commented 6 years ago

I have not heard back so will assume that this issue is resolved.