library(fgeo.tool)
path <- here::here("inst/issues/iss36/VFT10.csv")

# Fails because read_vft expects tab delimited
read_vft(path)
## Warning: The following named parsers don't match the column names: DBHID,
## PlotName, PlotID, Family, Genus, SpeciesName, Mnemonic, Subspecies,
## SpeciesID, SubspeciesID, QuadratName, QuadratID, PX, PY, QX, QY, TreeID,
## Tag, StemID, StemNumber, StemTag, PrimaryStem, CensusID, PlotCensusNumber,
## DBH, HOM, ExactDate, Date, ListOfTSM, HighHOM, LargeStem, Status
## # A tibble: 9 x 1
##   `DBHID,PlotName,PlotID,Family,Genus,SpeciesName,Mnemonic,Subspecies,Spe~
##   <chr>                                                                   
## 1 1,sinharaja,1,Euphorbiaceae,Aporosa,,APOR**,NULL,12,NULL,0000,1,0.05000~
## 2 423321,sinharaja,1,Euphorbiaceae,Aporosa,,APOR**,NULL,12,NULL,0000,1,0.~
## 3 3,sinharaja,1,Euphorbiaceae,Aporosa,,APOR**,NULL,12,NULL,0000,1,0.05000~
## 4 720408,sinharaja,1,Euphorbiaceae,Aporosa,,APOR**,NULL,12,NULL,0000,1,0.~
## 5 4,sinharaja,1,Myristicaceae,Myristica,dactyloides,MYRIDA,NULL,142,NULL,~
## 6 423324,sinharaja,1,Myristicaceae,Myristica,dactyloides,MYRIDA,NULL,142,~
## 7 6,sinharaja,1,Myristicaceae,Myristica,dactyloides,MYRIDA,NULL,142,NULL,~
## 8 720409,sinharaja,1,Myristicaceae,Myristica,dactyloides,MYRIDA,NULL,142,~
## 9 7,sinharaja,1,Malvaceae,Durio,ceylanica,CULLCE,NULL,49,NULL,0000,1,1.50~
# Fix by using the argument `delim` to specify that this is comma separated
read_vft(path, delim = ", ")
## # A tibble: 9 x 32
##    DBHID PlotName  PlotID Family    Genus  SpeciesName Mnemonic Subspecies
##    <int> <chr>      <int> <chr>     <chr>  <chr>       <chr>    <chr>     
## 1      1 sinharaja      1 Euphorbi~ Aporo~ <NA>        APOR**   <NA>      
## 2 423321 sinharaja      1 Euphorbi~ Aporo~ <NA>        APOR**   <NA>      
## 3      3 sinharaja      1 Euphorbi~ Aporo~ <NA>        APOR**   <NA>      
## 4 720408 sinharaja      1 Euphorbi~ Aporo~ <NA>        APOR**   <NA>      
## 5      4 sinharaja      1 Myristic~ Myris~ dactyloides MYRIDA   <NA>      
## 6 423324 sinharaja      1 Myristic~ Myris~ dactyloides MYRIDA   <NA>      
## 7      6 sinharaja      1 Myristic~ Myris~ dactyloides MYRIDA   <NA>      
## 8 720409 sinharaja      1 Myristic~ Myris~ dactyloides MYRIDA   <NA>      
## 9      7 sinharaja      1 Malvaceae Durio  ceylanica   CULLCE   <NA>      
## # ... with 24 more variables: SpeciesID <int>, SubspeciesID <chr>,
## #   QuadratName <chr>, QuadratID <int>, PX <dbl>, PY <dbl>, QX <dbl>,
## #   QY <dbl>, TreeID <int>, Tag <chr>, StemID <int>, StemNumber <int>,
## #   StemTag <int>, PrimaryStem <chr>, CensusID <int>,
## #   PlotCensusNumber <int>, DBH <dbl>, HOM <dbl>, ExactDate <date>,
## #   Date <int>, ListOfTSM <chr>, HighHOM <int>, LargeStem <chr>,
## #   Status <chr>