tokami / TropFishR

Tropical Fisheries Analysis with R
24 stars 19 forks source link

catchCurve #17

Closed ppagliosa closed 7 years ago

ppagliosa commented 7 years ago

Dear Tobias Mildenberger, I am having some trobles running "catchCurve" function. I modified my length-frequency data with the "lfqModify" function and, after run catchCurve the programm returns the following message:"Error: "x" must be numeric.". In fact the same message return when I run the examples contained in the help of the catchCurve function. It is maybe possible that the function is not working properly? I thank you in advance.

marchtaylor commented 7 years ago

@ppagliosa - without a reproducible example, debugging your issue will be difficult. I just ran the examples and all seem to run correctly. I assume that you selected via mouse-clicks your end points for the regression?

ppagliosa commented 7 years ago

Hi, I am trying:

data(goatfish) catchCurve(goatfish) Error: 'x' must be numeric.

marchtaylor commented 7 years ago

This works for me. Have you tried reinstalling? devtools::install_github(“tokami/TropFishR”)

Here is what I did:

library(TropFishR)
data(goatfish)
output <- catchCurve(goatfish)
summary(output$linear_mod)

I selected points 8 and 14. Here is the screenshot:

clipboard01

ppagliosa commented 7 years ago

Hi, I think I discovered what is wrong.
When I load only "TropfishR" the script (and examples) works fine. When I load "TropfishR" and "FSA" packages the error happened. I think this happens because the two packages have a function named "catchCurve", but they use different objects to run. Seems like when the two packages were loaded the "FSA" catchCurve function surpass the catchCurve function of the "TropfishR". Anyway, thank you for the help.

marchtaylor commented 7 years ago

OK, glad you solved the issue. If you have a conflict, you can use TropFishR::catchCurve() to call the correct function. Hopefully there aren't too many conflicting function names.

ppagliosa commented 7 years ago

great. Thanks!!!