tristan-sebens / metl

An R package developed by and for the AFSC MESA group for extracting and standardizing data from telemetry tags.
GNU General Public License v3.0
0 stars 0 forks source link

non function error in metl version 4. #118

Closed kechave closed 2 months ago

kechave commented 2 months ago

Error: Attempt to apply a non function.

Error after running decoder function in metl version 4.

tristan-sebens commented 2 months ago

Could you provide the code you ran that caused the problem?

kechave commented 2 months ago
# Set this variable to the root of your tag data directory:GG 2466
d = tcltk::tk_choose.dir('C:/Users/katy.echave/Desktop/METL Test/Lotek/Lotek_1300/Greenland turbot/2466')
if(!dir.exists(d)) stop("Directory does not exist")

# Decoder to detect Tag Type
supported_decoders()

decoder = decoders$Lotek_1300

meta =
  data.frame(
    tag_num = "2466", # Tag ID number
    tag_type = "GG", # Tag type, as specified in ABLTAG DB
    tag_num_secondary = "", # Secondary tag ID number
    tag_type_secondary = "", # Secondary tag type
    species_code = 10115, # Species code, as specified in ABLTAG DB
    seq_num = 1 # Sequence number. Check DB doc for more details.
  )

decoder$decode_to_db(d = d, con = db_conn, meta = meta)
tristan-sebens commented 2 months ago

I think this is because of how you're setting your decoder object. The syntax has changed a little bit for the sake of organization.

decoder = decoders$Lotek_1300

is now

decoder = decoders$Lotek$LTD_1300

This was one of the changes made in the last release. I updated the README example with the release, in case you need another reference.

kechave commented 2 months ago

bingo. thanks!

tristan-sebens commented 2 months ago

No problem, glad it worked!