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

Radish() error length(s$demes) == nrow(S) is not TRUE #8

Open
j3ss42 opened this issue Dec 5, 2023 · 0 comments
Open

Radish() error length(s$demes) == nrow(S) is not TRUE #8

j3ss42 opened this issue Dec 5, 2023 · 0 comments

Comments

@j3ss42
Copy link

j3ss42 commented Dec 5, 2023

Hi,
I am trying to optimise a categorical resistance surface, which contains landcover data with pre-assigned resistance values from the literature. I would like to optimise this to identify which landcovers are important for gene flow in my study area.

I ratify the categorical variables following the tutorial, and make a conductance surface using the below code:
surface_gsp <- conductance_surface(covariates = stack(Region_rat), coords = Coords, directions = 4)

I then make a Euclidean genetic distance matrix using dist() in adegenet between all samples.

I then try to fit mlpe using the below code:
fit_mlpe_cat <- radish(Genetic_dist ~ Region_Mosaic, data = surface_gsp,
conductance_model = radish::loglinear_conductance,
measurement_model = radish::mlpe)

However I get the error code below almost immediately:
Projected Newton-Raphson with Hager-Zhang line search
Error in radish_algorithm(f = conductance_model, g = measurement_model, :
length(s$demes) == nrow(S) is not TRUE

What is s$demes and nrow(S) referring to? I would greatly appreciate any guidance on how to get this to work.

Many thanks

@j3ss42 j3ss42 changed the title rownames(formula_covariates) %in% colnames(spdat) is not TRUE Radish() error length(s$demes) == nrow(S) is not TRUE Dec 11, 2023
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

1 participant