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

Plot_maps function error #367

Open
Mahdi2022 opened this issue Feb 23, 2023 · 3 comments
Open

Plot_maps function error #367

Mahdi2022 opened this issue Feb 23, 2023 · 3 comments

Comments

@Mahdi2022
Copy link

Hello! I have tried to run the function below:

plot_maps(plot_set=c(3), TmbData = TmbData, MappingDetails=MapDetails_List[["MappingDetails"]], Report=Report, Sdreport=Opt$SD, PlotDF=MapDetails_List[["PlotDF"]], MapSizeRatio=MapDetails_List[["MapSizeRatio"]], Xlim=MapDetails_List[["Xlim"]], Ylim=MapDetails_List[["Ylim"]], FileName=DateFile, Year_Set= Year_Set, Years2Include=Years2Include, Rotate=MapDetails_List[["Rotate"]], Cex=MapDetails_List[["Cex"]], Legend=MapDetails_List[["Legend"]],zone=MapDetails_List[["Zone"]], mar=c(0,0,2,0), oma=c(3.5,3.5,0,0), cex=1.8, category_names=levels(Data_Geostat[,'species']))

but I got this error: Error in Mat[PlotDF[, "x2i"], , drop = FALSE] : subscript out of bounds

Could you please tell me how to solve this issue? I looked at the function PlotMap_Fn, but I don't know what precisely the "Mat" do?

@James-Thorson-NOAA
Copy link
Owner

You're calling mid-level functions directly, which is prone to some user-errors. Can you confirm whether you can run the index exmaple on the wiki including the plot(fit) call without errors?

And what packageVersion("VAST") and packageVersion("FishStatsUtils") are you using?

@EllenY
Copy link

EllenY commented Feb 23, 2023

Thanks Jim!
packageVersion("VAST")
[1] ‘3.10.1’
packageVersion("FishStatsUtils")
[1] ‘2.12.1’

We updated the user_region using a shapefile provided by Aleksei. Then added the correct projargs to plot the western Bering Sea.

plot(fit, settings=settings, plot_set=c(3,11,12,14,15), projargs = "+proj=aea +lat_0=50 +lon_0=180 +lat_1=55 +lat_2=65 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs", n_cells=2000)

@Mahdi2022
Copy link
Author

Mahdi2022 commented Feb 23, 2023

I am using the following version:

packageVersion("VAST")
[1] ‘2.0.1’
packageVersion("FishStatsUtils")
[1] ‘1.0.0’

I can not run plot(fit) as I am using the older version of VAST. The newest version of VAST does not work well on my laptop.

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

3 participants