tokami / TropFishR

Tropical Fisheries Analysis with R
25 stars 19 forks source link

How to input multi-year length frequency data in TropFishR Package for the stock assessment? #45

Open NRagavan opened 1 year ago

NRagavan commented 1 year ago

I am currently conducting research on shrimp stock assessment using the ‘TropFishR’ package to analyze a monthly carapace length frequency dataset. The package allows for the analysis of one year of data, specifically data collected from January to December of a particular year. Sample code for opening the library, working with an Excel file, and opening the dataset from the working directory is provided below:

Open the TropFishR library

library(TropFishR)

Open the Excel data file

library(openxlsx)

Set the working directory where the data is located

setwd

Open the dataset in the working directory

data <- read.xlsx("frequency.xlsx")

To reproduce the result

set.seed(1)

Define the date, assuming 15 as the midpoint of sampling days

1:12 indicates data collected from January to December

-2022 indicates the year, with the remaining codes remaining the same

dates <- as.Date(paste0("15-",01:12,"-2022"),format="%d-%m-%Y") However, if we have more than one year of data, how can we feed it into the ‘TropFishR’ package?

shaniAmare commented 1 year ago

Not an expert, but did you see the data arrangement 3 from this tutorial? https://cran.r-project.org/web/packages/TropFishR/vignettes/lfqData.html - probably is what you want?

NRagavan commented 1 year ago

Dear Shani, Thank you very much for your answer.

On Thu, Aug 17, 2023 at 11:55 AM Shani Amarasinghe @.***> wrote:

Not an expert, but did you see the data arrangement 3 from this tutorial? https://cran.r-project.org/web/packages/TropFishR/vignettes/lfqData.html

  • probably is what you want?

— Reply to this email directly, view it on GitHub https://github.com/tokami/TropFishR/issues/45#issuecomment-1681684250, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7UKNF4X3ZIRS57WGKZHDO3XVW2OHANCNFSM6AAAAAAXXH6XCE . You are receiving this because you authored the thread.Message ID: @.***>

-- Ragavan Nadarajah Lecturer (Probationary) [image: Banner] https://wa.link/cxk3dj [image: Logo] http://www.fsc.jfn.ac.lk/index.php/ragav-anna/ t: m: e: a: (+94) 21 222 2305 (+94) 77 007 2328 @.*** Department of Fisheries, University of Jaffna, Jaffna, 40000, Sri Lanka www.fsc.jfn.ac.lk/