Prometheus
Prometheus

Reputation: 2017

Pandoc not recognized as R library

I installed Pandoc manually through this installation - link.

After restarting the system, I was able to locate the installation folder at C:/Users/YourUserName/AppData/Local/Pandoc

But when I'm trying to call the library:

library("pandoc", lib.loc = "C:/Users/YourUserName/AppData/Local/Pandoc")

I'm getting the following error:

Error in library("pandoc", lib.loc = "C:/Users/YourUserName/AppData/Local/Pandoc") : 
  no library trees found in 'lib.loc'

As i'm behind a firewall, I cannot install pandoc through github. So the install.pandoc() function is out.

Any ideas where I'm getting the installation process wrong?

Edit:

I've changed .LibPath to point to Pandoc's installation folder:

.libPaths('C:/Users/stefanj/AppData/Local/Pandoc')

And if I check, it seems to be ok:

> grep("pandoc", list.files(.libPaths()))
  [1] 22 24

library(pandoc)

Error in library(pandoc) : there is no package called ‘pandoc’
Execution halted

Upvotes: 1

Views: 2089

Answers (1)

parth
parth

Reputation: 1631

I agree to @Dason's point that library in path : "C:/Users/YourUserName/AppData/Local/Pandoc" is not any library/package connected with R. It's just pandoc installed.

Other way to install pandoc would be using installr :

installr::install.pandoc()

Now, for performing for converting from one markup format to another, use the following package :

rmarkdown

The rmarkdown package includes high level functions for converting to a variety of formats. For example:

render("input.Rmd", html_document())
render("input.Rmd", pdf_document())

Hope this helps.

Upvotes: 1

Related Questions