Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error_message M-LED process_clusters.R #23

Open
beniaminogallizia opened this issue Oct 21, 2024 · 13 comments
Open

error_message M-LED process_clusters.R #23

beniaminogallizia opened this issue Oct 21, 2024 · 13 comments

Comments

@beniaminogallizia
Copy link

Hi,
I'm working on a new country, Mozambique. I'm aving this error message while running process_cluster.R. In particular the run stopped at line 79. I already checked the version for R and Rstudio.

Error in (function (cond) :
error in evaluating the argument 'x' in selecting a method for function 'raster': subscript out of bounds

cluster

This is the clusters' matrix.

Do you have any suggestions?

Thank you in advance.

Beniamino

@giacfalk
Copy link
Collaborator

Dear @beniaminogallizia, great that you are looking into an implementation of M-LED for Mozambique.

The reason is most likely that you did no download the nighttime light dataset that is being read in line 79.

The data file in question is referred to here: https://github.com/iiasa/RE4AFAGRI_platform/wiki/Examples-and-exercises#preparing-the-population-clusters-also-relevant-for-onsset and can be downloaded from here: https://eogdata.mines.edu/nighttime_light/annual/v21/2021/VNL_v21_npp_2021_global_vcmslcfg_c202205302300.median_masked.dat.tif.gz.

Could you confirm if you downloaded it and unzipped it?

@beniaminogallizia
Copy link
Author

It works! I was using the nighttime light file specific for Mozambique that i used for OnSSET, apparently it was not suitable.

Thank you again!

@giacfalk
Copy link
Collaborator

Great! Please keep us posted on your model development outcomes, if you wish :)

@beniaminogallizia
Copy link
Author

Hi giacomo, i'm encountering another issue.
I'm trying to manually installing some packages from gz files where the code give me errors installing from sources.
random
Do you have any suggestions?

@giacfalk
Copy link
Collaborator

Dear @beniaminogallizia, what version of R are you using?

@beniaminogallizia
Copy link
Author

I'm using the following version: R-4.2.3. As suggested in one of the previous issue I didn't downgrade Rstudio.

@giacfalk
Copy link
Collaborator

giacfalk commented Oct 24, 2024

did you try to add the dependencies=T argument in the install call? Otherwise, I did not get why you are instlaling manually some packages. Don't they install via CRAN?

@beniaminogallizia
Copy link
Author

It showed me the message below so I look for other versions in the web (https://cran.r-project.org/src/contrib/Archive/randomForestSRC/).
random

I didn't try too add dependencies=T, i'll try it.

Thank you

@beniaminogallizia
Copy link
Author

Hi Giacomo,
i'm having this error message that i'm not able to solve:
error
this error is related to an if sentence introduced in the electricity_access.R file:
prio
!is.na(unique(values(resources))) should gives just one boolean value but it returns a boolean vector. I don't know how to proceed.
Can you help me understand how to interpret this part of the model?
Thank you

@giacfalk
Copy link
Collaborator

Hi @beniaminogallizia ,

Can you post the console output of running unique(values(resources)) ?

Thanks

@beniaminogallizia
Copy link
Author

unique

@giacfalk
Copy link
Collaborator

giacfalk commented Oct 29, 2024

I think there is an issue with the object resources.

Could you please run lines 60-75 of the electricity_access.R file

prio <- read.csv(find_it("PRIO-GRID Static Variables - 2021-05-24.csv"))
and then post the console output of the resources object?

@beniaminogallizia
Copy link
Author

Good afternoon Giacomo,

I change the machine in order to have a larger CPU, now i'm using the work station of my institution. I'm facing the same problem.
This is the result from summary(resources):
layer
Min. 1
1st Qu. 1
Median 1
3rd Qu. 1
Max. 1
NA's 2507889
while this is the output for View(resources):
clusters-view

Do you have any suggestions on how to solve the issue?

Thank you in advance for the patience.

Beniamino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants