小编Mic*_*hał的帖子

如何在使用knitr生成的PDF中实现黑白友好语法高亮

我正在编写一个带有knitr(Rnw将被处理为PDF)的文档,该文档将以黑白打印.我仍然希望代码块具有语法高亮.

是否有可能以及如何修改默认语法高亮颜色以使用某些灰度等?

PS.我不想切换到LaTeX'listing'包.

latex r knitr

7
推荐指数
1
解决办法
613
查看次数

如何删除 httr::GET 保留的 cookie?

httr::GET 在向同一网站发出请求时保留 cookie。

  1. 是否可以查询那些保留的 cookie?
  2. 如何刷新那些保存的 cookie 并再次发出“原始”请求?

例子:

# Get login cookie
r1 <- GET("https://some.url/login", authenticate("foo", "bar"))

cookies(r1)
# returns a data frame of two cookies

# Make request that requires authentication cookie
# Only succeeds if r1 was made
r2 <- GET("https://some.url/data/?query&subset=1")
r2
Run Code Online (Sandbox Code Playgroud)

请注意,制作时r2您不必明确传递任何 cookie 信息,因为它们会自动存储在某处。

我想知道如何查询或删除这些存储的 cookie?

r httr

6
推荐指数
1
解决办法
1216
查看次数

R包'Boom'无法在Ubuntu linux上安装

出于某种原因,R包"Boom"无法在我的系统上安装(Ubuntu 14.04).R和所有其他软件包都是最新版本(包括'BH').由于'Boom'在CRAN上,应该预期软件包将安装没有任何问题(例如,在R上安装软件包,需要OSX的C++ 11支持).但是,我不知道如何追查原因:我的设置可能与"标准"有什么不同,因此无法安装包?去哪儿看?

以下是安装日志的违规部分:

g++ -std=c++11 -I/usr/share/R/include -DNDEBUG -I. -I../inst/include -IBmath -Imath/cephes -DNO_BOOST_THREADS -DNO_BOOST_FILESYSTEM -DADD_ -DRLANGUAGE  -I"/home/mbojan/R/library/3.2/BH/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c Models/PosteriorSamplers/DirichletPosteriorSampler.cpp -o Models/PosteriorSamplers/DirichletPosteriorSampler.o
Models/PosteriorSamplers/DirichletPosteriorSampler.cpp: In member function ‘void BOOM::DirichletPosteriorSampler::draw_impl(const std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> >&, const BOOM::Vector&)’:
Models/PosteriorSamplers/DirichletPosteriorSampler.cpp:90:65: error: no matching function for call to ‘std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> >::erase(__gnu_cxx::__normal_iterator<const std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl>*, std::vector<std::shared_ptr<BOOM::DirichletSampler::DirichletSamplerImpl> > >)’
         other_implementations.erase(impl.begin() + which_sampler);
                                                                 ^
Models/PosteriorSamplers/DirichletPosteriorSampler.cpp:90:65: note: candidates are:
In file included from /usr/include/c++/4.8/vector:69:0,
                 from ../inst/include/Models/DataTypes.hpp:24,
                 from ../inst/include/Models/ParamTypes.hpp:22,
                 from ../inst/include/Models/ModelTypes.hpp:22,
                 from ../inst/include/Models/DirichletModel.hpp:22,
                 from ../inst/include/Models/PosteriorSamplers/DirichletPosteriorSampler.hpp:23,
                 from …
Run Code Online (Sandbox Code Playgroud)

ubuntu r

3
推荐指数
1
解决办法
1410
查看次数

标签 统计

r ×3

httr ×1

knitr ×1

latex ×1

ubuntu ×1