背景:在我的工作中,我们使用SVN,C#和VisualStudio.我的部分任务经常涉及全局重命名.通常,在重命名某些内容然后合并更改之后,我最终会遇到损坏的构建.
问题是:有没有可以查看我的更改的解决方案,注意全局重命名,然后将其应用于其他人在合并时进行的编辑?
另一种获得相同效果的方法是使用某种重构日志,然后将其应用于传入编辑.
该工具不一定是完美的,即使它只是注意到他们所编辑的任何引用都提到我编辑过的东西是有价值的.
编辑我知道VS的重构工具.在我重构我的工作副本之后,我正在寻找的东西将允许我将相同的重构应用于我现在需要合并的其他人编辑.
理想的解决方案是确保在进行重构时没有未完成的编辑,但这样可以防止其他人在下周或更长时间内完成任何操作.(因为他们必须在下周每半小时左右同步一次)
我需要一个剪贴板查看器,以便了解我收到的数据的类型和内容.是否有任何此类程序(对于Windows)可以让您浏览当前在剪贴板中的任何类型的数据?
ClipSpy:不幸的是,唯一可行的多格式查看器ClipSpy向我展示了每10个字符包装的字符串数据,并扩展了我不关心的十六进制和二进制视图.
在构建mypackage时,一切似乎都有效:
library(devtools)
build(vignettes = T, manual = T)
* checking for file ‘/storage/Documents/client/validate/mypackage/DESCRIPTION’ ... OK
* preparing ‘mypackage’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building ‘mypackage_0.1.tar.gz’
[1] "/storage/Documents/client/validate/mypackage_0.1.tar.gz"
Run Code Online (Sandbox Code Playgroud)
但是我找不到PDF手册和小插图.
Vignette:遵循此处所述的工作流程,使用RStudio/devtools/markdown.然而:
vignette("mypackage")警告信息:未找到插图'mypackage'
对于PDF手册,我试过这个,但没有成功.
所以,我的问题是:我在哪里可以找到PDF手册和小插图?
我试图在R版本3.2.1中安装devtools,但是当我这样做时会抛出以下错误:
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing libxml-2.0.pc
to the PKG_CONFIG_PATH environment variable
Run Code Online (Sandbox Code Playgroud)
当我dpkg -L libxml2-dev在终端中运行时,我发现:
/usr
/usr/bin
/usr/bin/xml2-config
/usr/share
/usr/share/aclocal
/usr/share/aclocal/libxml2.m4
/usr/share/doc
/usr/share/doc/libxml2-dev
/usr/share/doc/libxml2-dev/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/xml2-config.1.gz
/usr/share/man/man3
/usr/share/man/man3/libxml.3.gz
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libxml2.a
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/libxml-2.0.pc
/usr/lib/x86_64-linux-gnu/xml2Conf.sh
/usr/include
/usr/include/libxml2
/usr/include/libxml2/libxml
/usr/include/libxml2/libxml/globals.h
/usr/include/libxml2/libxml/schematron.h
/usr/include/libxml2/libxml/xlink.h
/usr/include/libxml2/libxml/HTMLparser.h
/usr/include/libxml2/libxml/pattern.h
/usr/include/libxml2/libxml/xmlexports.h
/usr/include/libxml2/libxml/xmlschemas.h
/usr/include/libxml2/libxml/list.h
/usr/include/libxml2/libxml/entities.h
/usr/include/libxml2/libxml/xmlstring.h
/usr/include/libxml2/libxml/encoding.h
/usr/include/libxml2/libxml/hash.h
/usr/include/libxml2/libxml/xmlmemory.h
/usr/include/libxml2/libxml/relaxng.h
/usr/include/libxml2/libxml/xmlsave.h
/usr/include/libxml2/libxml/SAX2.h
/usr/include/libxml2/libxml/xmlIO.h
/usr/include/libxml2/libxml/xmlschemastypes.h
/usr/include/libxml2/libxml/xpathInternals.h
/usr/include/libxml2/libxml/schemasInternals.h
/usr/include/libxml2/libxml/xmlmodule.h
/usr/include/libxml2/libxml/valid.h
/usr/include/libxml2/libxml/c14n.h
/usr/include/libxml2/libxml/xmlwriter.h
/usr/include/libxml2/libxml/tree.h
/usr/include/libxml2/libxml/xmlunicode.h
/usr/include/libxml2/libxml/nanohttp.h
/usr/include/libxml2/libxml/catalog.h …Run Code Online (Sandbox Code Playgroud) 一些R包(例如 ggplot2,dplyr,devtools等)已按字母顺序题为他们的帮助/文档和链接到那些部分一栏(如下图红色箭头表示)的部分.其他包(例如RcmdrMisc)没有.
如何将这些元素添加到R包的帮助中?
我roxygen2用于文档.
我尝试Knit HTML了以下Rmd文件:
---
title: "Untitled"
author: "Florian Privé"
date: "12 septembre 2016"
output: html_document
---
```{r fibCpp, engine='Rcpp'}
#include <Rcpp.h>
// [[Rcpp::export]]
int fibonacci(const int x) {
if (x == 0 || x == 1) return(x);
return (fibonacci(x - 1)) + fibonacci(x - 2);
}
```
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Building shared library for Rcpp code chunk...
Warning message:
l'exécution de la commande 'make -f "C:/PROGRA~1/R/R-33~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_2.dll" WIN=64 TCLBIN=64 OBJECTS="file110c1d4643e9.o"' renvoie un statut 127
Quitting from lines …Run Code Online (Sandbox Code Playgroud) 有没有办法重现使用的环境devtools::check?
我有问题,我的测试工作devtools::test()但内部失败devtools::check().我的问题是现在,如何找到问题.报告check只是打印错误日志的最后几行,我找不到完整的测试报告.
checking tests ... ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
...
Run Code Online (Sandbox Code Playgroud)
我知道check使用不同的环境相比,test但我不知道如何调试这些问题,因为它们根本不可重现.特别是这些测试在几个月前运行,所以不知道在哪里寻找问题.
编辑
实际上我试图找到我的问题,我找到了解决方案.但要发布我的解决方案,我必须添加更多细节.
所以我的测试总是失败,因为我测试了markdown脚本,如果它运行没有错误,之后我检查是否正确设置了一些环境变量.这些是我用脚本计算的结果以及我设置的标准设置.因此,如果我在开发后忘记更改某些设置,我想收到警告...
无论如何,既然是降价剧本,我不得不提取代码,我是用这个职位评论knitr:运行Rmarkdown文档中的所有数据块使用knitr::purl,以获取代码,并sys.source执行它.
runAllChunks <- function(rmd, envir=globalenv()){
# as found here https://stackoverflow.com/questions/24753969
tempR <- tempfile(tmpdir = '.', fileext = ".R")
on.exit(unlink(tempR))
knitr::purl(rmd, output=tempR, quiet=TRUE)
sys.source(tempR, envir=envir)
}
Run Code Online (Sandbox Code Playgroud)
出于某种原因,这会产生一个错误,因为可能会持续几周(不确定我最近安装了哪些新软件包......).但是由于有一个新的评论,我可以使用knitr::knit它也执行代码,这按预期工作,现在我的测试不再抱怨.
所以最后,我不知道问题究竟在哪里,但现在正在发挥作用.
Google Chrome浏览器具有一项可以运行的功能,monitorEvents(document)并且您触发的每个事件都将记录在控制台中。
如何在FireFox中获得类似的功能?
我遇到了这个非常过时的答案,但是Firebug甚至不复存在:使用Firefox,我如何监视所有触发的JavaScript事件?
我正在尝试devtools使用以下代码将github 的开发版本安装到R Open 3.5.1:
library(devtools)
devtools::install_github("r-lib/devtools")
Run Code Online (Sandbox Code Playgroud)
第一次尝试时,出现以下输出/错误:
Downloading GitHub repo r-lib/devtools@master
? checking for file 'C:\Users\JT\AppData\Local\Temp\Rtmp8Cq1sJ\remotes215c357871af\r-lib-devtools-ab6c878/DESCRIPTION'
1. preparing 'devtools':
? checking DESCRIPTION meta-information ...
2. checking for LF line-endings in source and make files and shell scripts
3. checking for empty or unneeded directories
4. building 'devtools_2.0.2.9000.tar.gz'
5. installing *source* package 'devtools' ...
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices …Run Code Online (Sandbox Code Playgroud) 我有一系列数据框,我想在我的包中保存为单独的.rda文件.
我可以使用,devtools::use_data(my.df1, my.df2...)但我没有每个数据框的命名对象,它们都存储在一个大的列表中.
我想要做的是为每个列表元素调用use_data并使用列表名称作为.rda文件名.但是,当我执行以下操作时,我收到一条错误消息:
> lapply(my.list, devtools::use_data, overwrite = TRUE)
Error: Can only save existing named objects
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?