adrianhordyk / lbspr Goto Github PK
View Code? Open in Web Editor NEWLength Based Spawning Potential Ratio R Package
Length Based Spawning Potential Ratio R Package
Line 278 of https://github.com/AdrianHordyk/LBSPR/blob/master/inst/shiny_apps/LBSPR/server.r should say
if (inherits(dat, "numeric") | inherits(dat,"integer")) {
as a comma is missing after dat
. Sorry I cannot submit it as a pull request right now.
Hi, AdrianHordyk.
I uploaded my data and found out that the estimated parameters (SL50, SL95, F / M, SPR) are slightly different when they are calculated in the LBSPR package and LBSPR Shiny App. There are differences in both cases (the individual point estimates and the smoothed ones). The difference between the parameters are the same: for SL50 - 0.2, SL95 - 0.2, F / M - (-0.02 or - 0.03), SPR - 0.01.
Could you explain the reason for the difference in parameter values?
Dear
I try to run the LBSPR method to my data. but i find a little problem in the section 'Reading in Example CSV'
Actually, i couldn't read my csv file wich contain my data. so please can you help me in this case. i am sorry for this but i am a bigguner in R.
Thank you very much
Hello Adrian !
I have got some issus when trying to run the LBSPR script with my data. I followed the script as it is explains but the problem appears in the "Reading in Example CSV" part when I try to create the object with my length frequency data in this command ;
Len2 <- new("LB_lengths", LB_pars=MyPars, file=paste0(datdir, "/LFreq_MultiYrHead.csv"), dataType="freq", header=TRUE)
I tried several thing, but the file is related to the function DataDir with sends everything to a place I can't find on my laptop. Even by changing the data in the csv file directly in the LBSPR package it doesn't change anything when importing data. So I tried to change the data directory with the DataDir function but it's not working. And finally, without the DataDir function, and by using read.csv2 with my file it's not working, maybe because of the "new" function?
Anyway, can you help me so that I can run the script with my data please ? I hope my explanations are clear !
Thanks in adavance
Gabrielle Cotonéa
Hi Adrian Hordyk.
I study a manual for LBSPR package. I ran into one problem - can not plot the imported length data.
I run all codes in the manual :
MyPars <- new("LB_pars")
MyPars@Species <- "MySpecies"
MyPars@Linf <- 100
MyPars@L50 <- 66
MyPars@L95 <- 70
MyPars@MK <- 1.5
MyPars@L_units <- "mm"
Len1 <- new("LB_lengths", LB_pars=MyPars, file=paste0(datdir, "/LFreq_MultiYr.csv"),
dataType="freq")
Len2 <- new("LB_lengths", LB_pars=MyPars, file=paste0(datdir, "/LFreq_MultiYrHead.csv"),
dataType="freq", header=TRUE)
Len3 <- new("LB_lengths", LB_pars=MyPars, file=paste0(datdir, "/LRaw_MultiYr.csv"),
dataType="raw")
PlotSize (Len1) an so on.
But i get wrong plots like in an attached file.
Could you explaine what i do wrong?
Hi, I was wondering if it is possible to force the SL50 and SL95 outputs from LBSPRfit()
, instead of having them estimated?
I tried adding SL50 and SL95 parameters to the LB_pars
object before adding our length measurement data, but it seems that LBSPRfit()
still estimates the SL50 and SL95 independently from the data.
If I am not mistaken, the initialize method for LB_lengths
is designed to be used with data in files, but it becomes difficult to use it inside R when the length samples are in an R object in the workspace.
I am trying to run LBSPR inside some MSE simulations, and I seem to be forced to create an empty object and then populate the stocks directly.
My view is that the kind of input juggling that it is being done should be carried out by a creator method/function, LB_lengths()
, while a call to new()
should be able to simply assign named inputs to the corresponding slot.
I can't solve the issue. Please help me
LenFreq2 <- new("LB_lengths", LB_pars=MyPars, LenFreq, dataType="freq", header=FALSE)
Error in if (class(file) == "character") { : the condition has length > 1
Hi,
My first attempt to install the package (version 0.1.9000, commit 12849d3, R 3.3.2 64-bits on Windows) failed due to a missing 'colorspace' package.
Worked fine after installing it manually.
Yves
Dear Adrian,
in barefootecologist, what do you mean with parameters dL95 and dSL95 (Particullary what means the "d"). The codes in Rstudio didn't show what means.
Thanks
When trying to specify MLL and sdLegal in the LB_pars parameter, I receive this error:
Error in ZKLMat[L - 1, ] : incorrect number of dimensions
Code example below:
MyPars <- new("LB_pars")
MyPars@Species <- "Red hind"
MyPars@Linf <- 54.6
MyPars@L50 <- 21.5
MyPars@L95 <- 28.5
MyPars@M <- 0.24
MyPars@MK <- 0.24/0.176
MyPars@L_units <- "cm"
MyPars@FM <- 0.87
MyPars@SL50 <- 35
MyPars@SL95 <- 36
MyPars@MLL <- 35
MyPars@sdLegal <- 1
MySim <- LBSPRsim(MyPars)
Removing the parameters for MLL and sdLegal results in no error and a reasonable SPR (~0.61).
Am I specifying the MLL and sdLegal incorrectly?
What is parameter LB_pars@M
used for? Cannot find any code using this parameter.
The documentation indicates that plotTarg
returns a ggplot object.
However, plotTarg
returns a dataframe, unlike LBSPR's other plot functions,
Are the final lines of this function intentional?
...
print(Plot)
return(invisible(longDat))
Hi Adrian,
I was wondering how do you check whether the model has converged or not? Some other models have that build in and I was wondering if you had any advice or ideas to check that. When running the model my output numbers are pretty strange so I was wondering whether that might be something that I need to address and adjust for.
Thanks in advance,
Juliet
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.