I am new to blogdown, Hugo and the https://forum.posit.co. I hope that this site is right place to raise this topic.
This is the situation: I have successfully used R Markdown and established a HTML that demonstrates my R package's ability, which I call 'CF', to visualize my simulation with 'animation', 'ggplot' and 'gganimation' tools. I want to add 'shiny' tools to improve my 'CF' package. It seems doable with 'blogdown' and Hugo. I am uncertain that the following is useful, but I will offer it anyway: https://github.com/PJOssenbruggen/CF. It works!
I used yihui's procedure to establish a 'blogdown' site. When I tried to change the Hugo theme from 'lithium' to 'academic,' I ran into trouble. Hugo suggested that I establish a new R project. I did and I call it, 'academic-kickstart.'
Note, the use of the term: 'CF.' It is the name of one of my R packages. The file 'CF.md' appears nowhere in my two packages. After searching the web, I found some suggestions on how to address the problem that are similar to my issue. They don't fix the problem.
Problem
blogdown:::serve_site()
Rendering content/post/2018-02-10-academic-kickstart.Rmd
Error: object 'CF.mb' not found
Execution halted
Error in render_page(f) :
Failed to render 'content/post/2018-02-10-academic-kickstart.Rmd'
I tried to offer other information but I received a message that I cannot include 10 users in a message. I don't understand the message.
Could you include a brief explanation of what suggested solutions you tried that did not work? This would save people from re-suggesting them here. Also, worth noting that the object is CF.mb not CF.md (which would suggest it was looking for a markdown file). I'm not familiar with the filetype, which, from what I've been able to find, is either: a binary scene file for AutoDesk Maya, or memo field values for a Paradox database.
It's also helpful to abstract the problem out a bit. Basically, you are calling for something in the post that isn't there. Once you figure out what that something is (is it possible there's a typo somewhere?), there are several threads here, and elsewhere that can help you get that sorted.
(@raybuhr has a helpful post referenced in that last thread that might be helpful).
R_nvim_wd = -1
blogdown:::serve_site()
Rendering content/post/2018-02-10-academic-kickstart.Rmd
Error: object 'CF.mb' not found
Execution halted
Error in render_page(f) :
Failed to render 'content/post/2018-02-10-academic-kickstart.Rmd'
Searched. The file does not exist on my computer.
PJO:~ PJO$ find ~ -name "CF.md"
PJO:~ PJO$ find ~ -name "academic-kickstart.Rmd"
yihui added a commit that referenced this issue on Aug 5, 2017 @yihui
fix #63: make sure the working directory is preserved when calling Rs⌠âŚ
âŚcript
the Nvim-R plugin can mess up the working directoy, which sounds really bad...
devtools::session_info()
Session info ----------------------------------------------------------------------------------------
setting value
version R version 3.4.2 (2017-09-28)
system x86_64, darwin15.6.0
ui RStudio (1.1.383)
language (EN)
collate en_US.UTF-8
tz America/New_York
date 2018-02-11
Packages --------------------------------------------------------------------------------------------
package * version date source
ansistrings 1.0.0.9000 2018-01-31 Github (r-lib/ansistrings@f27619b)
assertthat 0.2.0 2017-04-11 cran (@0.2.0)
...
BAD. knit does not work.
.../vignettes/CFmarkdown.Rmd
Error: object 'CF.mb' not found
Execution halted
I get the following errors and warnings from
==> devtools::check(cleanup = FALSE)
checking top-level files ... NOTE
Non-standard files/directories found at top level:
âCF.mbâ âTZ.txtâ ârender_blogdown.txtâ
...
checking R code for possible problems ... NOTE
cfanim: no visible global function definition for âggplotâ
cfanim: no visible global function definition for âgeom_pointâ, ...
Undefined global functions or variables:
aes geom_line geom_point gganimate ggplot theme_bw theme_set x
...
cfanim(60, 3, 30, 0.25)
Error in ggplot(df, xlim = xlim, ylim = ylim, col = gray(0.5)) :
could not find function "ggplot".
Calls: cfanim
Execution halted
ggplot is part of the 'ggplot2' package and it is in the session:
ggplot2 * 2.2.1 2016-12-30 CRAN (R 3.4.0)
Second, 'ggplot' is not a package.
Finally,
Status: 1 ERROR, 2 NOTEs
checking examples ... ERROR
Running examples in âCF-Ex.Râ failed
The error most likely occurred in:
Conclusion
knit is looking for 'CF.mb' and cannot find it. There are other mysterious things going on that I must address. Right now, my major concern is diagnosing the knit problem.
Hmm, it's hard to tell what's going on since it (unsurprisingly) references files that are internal to your environment. Have you tried rebuilding things up from the bottom. e.g. Try knitting just a default Rmd, make sure that works; add individual code chunks, etc.?
This sounds like a good idea. I did the following:
Made a new vignette: devtools::use_vignette("CF-simple")
Removed all 'r chucks.' See below.
Ran 'knit' on 'CF-simple.'
Results:
Updating CF documentation
Loading CF
Warning: The existing 'NAMESPACE' file was not generated by roxygen2, and will not be overwritten.
Updating vignettes
Documentation completed
==> R CMD INSTALL --preclean --no-multiarch --with-keep.source CF
Error: object 'CF.mb' not found
Execution halted
Exited with status 1.
Here is the top portion of my simple vignette:
---
title: 'CF: A _Stochastic_ Car-Following Package'
author: Paul J. Ossenbruggen
date: '2018-02-12'
output:
html_document:
toc: yes
toc_depth: 2
toc_float:
collapsed: no
smooth_scroll: no
number_sections: no
theme: united
highlight: tango
vignette: >
\VignetteIndexEntry{"Test Vignette"}
\VignetteEngine{knitr::rmarkdown}
\VignetteEncoding{UTF-8}
---
I'm at a loss here. It seems unlikely that CF.mb would be totally unrelated to your package (CF).
Are you trying to do something with blogdown, or are you creating a vignette, or both? If it's about a package vignette, the package development category might be of more use (you can change the category, no need to cross-post).
I am not sure what you mean by 'package development category.' In my mind, I have two independent R projects. Let me explain.
In my last post, I created the 'CF-simple.Rmd' within the 'CF' Project.' It uses 'knitr' and R markdown. I have a separate package, called 'academic-kickstart,' where I use 'blogdown.' If I understand correctly, I have two package development projects (or categories?) that are independent of one another. Thus if right, the 'CF.mb' problem is related to the 'CF' Project only.
As I mentioned, I uninstalled 'blogdown' and reinstalled it again. It did not solve the 'CF.mb' problem but it wasn't to difficult to do. Do you think uninstalling 'Rstudio' and reinstalling it would solve the problem?
Of course, if I can 'change the category' then it seems as the way to go. I look forward to your response.
Dont apologize. You have been a great help. You made good suggestions and asked good questions. As I mentioned, I am new to the R community. Twice, I submitted questions to Rstudio IDE and received feedback from this group but none of their responses came close to the help that you provided. For example, it was suggested that my submit my question to TidyVerse, which I did. This is where you stepped in to help.
You mentioned that I should 'change the category.' Given the way that I established my R projects, it appears that knitr should be working. Upon further reflection, I think uninstalling and installing the RStudio app is a waste of time. My gut tells me that there is setting in knitr that needs to be changed.
Given the fundamental nature of my problem with the mysterious "CF.mb" file, is it the proper protocol to ask Yihui Xie for his opinion. He has written a book on knitr and developed blogdown. I noticed on several occassions that Yihui, as well as Hadley Wickham, have addressed questions about blogdown from people like myself, who were unable to solve a problem.