Error: pandoc document conversion failed AMETv1.4

Hello,
I have successfully installed and ran /script_analysis/aqExample/run_scatterplot.csh for a project in AMETv1.4. My sites file is sitex_IMPROVE_ARDEQ_JUL_TRIAL.csh.txt (4.9 KB) . But when I tried to run stats_plots_leaflet script ARDEQ_run_stats_plots_leaflet.csh.txt (5.0 KB) I get the following error (error log :stats_plots_leaflet.txt (2.2 KB)

Loading required package: leaflet
Loading required package: htmlwidgets
Loading required package: maps
Loading required package: mapdata
[1] "SELECT d.network,d.stat_id,s.lat,s.lon,d.ob_dates,d.ob_datee,d.ob_hour,d.month , d.SO4_ob, d.SO4_mod ,d.POCode,s.state from ARDEQ_JUL_TRIAL as d, site_metadata as s WHERE d.SO4_ob is not NULL and d.network=‘IMPROVE’ and s.stat_id=d.stat_id and d.ob_dates BETWEEN 20160701 and 20160731 and d.ob_datee BETWEEN 20160701 and 20160731 and ob_hour between 0 and 23 ORDER BY stat_id,ob_dates,ob_hour"
There were 14 warnings (use warnings() to see them)
pandoc: Could not find data file ARDEQ_JUL_TRIAL_SO4_1_stats_plot_NMB_files/leaflet-1.3.1/
Error: pandoc document conversion failed with error 97
Execution halted

I have ‘pandoc’ installed in my system pandoc

Please help

Hi,

I don’t think your immediate issue here is pandoc. That’s probably just the first error the code spit out. Can you confirm that the directory ARDEQ_JUL_TRIAL_SO4_1_stats_plot_NMB_files/leaflet-1.3.1/ exists in your output directory location? If not, there’s an issue with leaflet.

I do find it interesting that there is no error before the pandoc conversion. A good test to see where things might be going wrong is to try plotting something simple, like a time series or scatter plot for the same data and see if that works. If so, then there probably is some issue with pandoc (even though it is installed). If not, then we can figure out what the upstream error is and fix that.

Wyat

Hello @wyat.appel

Yes, I have the directory /stats_plots_leaflet/ARDEQ_JUL_TRIAL_SO4_1_stats_plot_NMB_files/leaflet-1.3.1

I can run scatterplot using the same data scatterplot.txt (1.8 KB)


please suggest

OK, that’s good news. So, the issue is probably with pandoc. One way to test this is to modify the AQ_Stats_Plots_leaflet.R code to not use pandoc and see if you still get an error. To do this, make the change below:

saveWidget(my.leaf, file=filename[i],selfcontained=T) # Use if PANDOC is available
#saveWidget(my.leaf, file=filename[i],selfcontained=F) # Use if PANDOC is not available

to

#saveWidget(my.leaf, file=filename[i],selfcontained=T) # Use if PANDOC is available
saveWidget(my.leaf, file=filename[i],selfcontained=F) # Use if PANDOC is not available

If that works without an error, than the problem is with pandoc, or really how pandoc is interacting with R. If that is the case, I would have to dig around to find out what’s going on. But let’s see what happens when you don’t use pandoc.

Wyat

I suspect that not using pandoc will work fine. It seems that others have run into this same issue. The thread below is long, but the last comment may be useful. Apparently trying to save the file to a network drive rather than locally may be the issue. For some reason, pandoc can’t find the path, even though it exists. Not sure this will be helpful or not.

" Apparently trying to save the file to a network drive rather than locally may be the issue"-I tried this but didn’t work.

Hello @wyat.appel
So, after applying these modifications:
saveWidget(my.leaf, file=filename[i],selfcontained=T) # Use if PANDOC is available
#saveWidget(my.leaf, file=filename[i],selfcontained=F) # Use if PANDOC is not available
to
#saveWidget(my.leaf, file=filename[i],selfcontained=T) # Use if PANDOC is available
saveWidget(my.leaf, file=filename[i],selfcontained=F) # Use if PANDOC is not available

I can successfully run the run_stats_plots_leaflet.csh. I got the outputs. So, Is there any other way to make it work with Pandoc?

Thank you so much.

Good question. What versions of R and pandoc are you currently using?

Unfortunately, this seems like a difficult problem to reproduce, so it’s difficult for me to fix. Maybe others some ideas. I’ll do some more digging and see if I can find anything to try though.

Wyat

Hello @wyat.appel

I have R v 3.6.0 and Pandoc v 1.12.3.1