pbs-assess / rosettafish

:fishing_pole_and_fish: An R package for translating fish- and fisheries-related terms
4 stars 15 forks source link

Recent error #21

Closed fssem1 closed 4 years ago

fssem1 commented 4 years ago

A few months ago I used this code to access your package: library("devtools") devtools::install_github("pbs-assess/rosettafish") library(rosettafish) source('state_space_model/code/functions.r')

terms.use <- read.csv("state_space_model/data/translation_terms.csv",stringsAsFactors = FALSE)

rosettafish::trans("Overfishing Profile", from = "english", to = "french", custom_terms = terms.use, allow_missing = FALSE)

Now this function does not work and I am getting the error: Error in xj[i] : only 0's may be mixed with negative subscripts translation_terms.txt

I included a text version of my translations (I use a csv in the above code but it would not attach a csv file.)

Also, I tried to use your directions to change the terms. csv file for the package and did not have any luck.

seananderson commented 4 years ago

Try it now after this. That works for me.

seananderson commented 4 years ago

For editing, the easiest:

  1. Edit the file directly on GitHub.
  2. Add the terms to the end of the file.
  3. Click the button to create a pull request.

Or, create an Issue on the GitHub site and give us your new translated terms.

I would generally do the a) etc. part using something like paste0() after to keep the dictionary more general.