Reputation: 2443
In the knitr manual:
aliases: (NULL) a named character vector to specify the aliases of chunk options
As my directory name is long, I want to use aliases
as below:
knitr::opts_knit$set(aliases = c(mydir = 'E:/web/cel/ae repo/middle temp data/20190303'), root.dir = mydir,base.dir = mydir)
But I got the error: can not find object mydir
. Where is the problem?
Upvotes: 2
Views: 73
Reputation: 14957
I think you're misunderstanding how the package option aliases
works:
To achieve what you're apparently trying to do, just define a new object mydir
and use it when setting the package options:
mydir <- 'E:/web/cel/ae repo/middle temp data/20190303'
knitr::opts_knit$set(root.dir = mydir, base.dir = mydir)
Upvotes: 2