Not able to install xkcd fonts

I was trying the xkcd font as per the instructions given in the vignette: vignette("xkcd-intro") However get an error on the following step: > system("cp xkcd.tff -t ~/.fonts") cp: xkcd.tff: No such file or directory cp: -t: No such file or directory What to do?? Are you sure it's not supposed to be xkcd.ttf instead of xkcd.tff ? I'm fairly certain that cp SOURCE OPTI

无法安装xkcd字体

我按照小vignette("xkcd-intro")提供的说明尝试xkcd字体: vignette("xkcd-intro") 但是,在以下步骤中出现错误: > system("cp xkcd.tff -t ~/.fonts") cp: xkcd.tff: No such file or directory cp: -t: No such file or directory 该怎么办?? 你确定它不应该是xkcd.ttf而不是xkcd.tff吗? 我很确定cp SOURCE OPTION DESTINATION不是在任何Unix系统上合法使用cp 。 事实上,由于您只复制一

Can I edit the NAMESPACE file without rebuilding the package?

I've got an existing package in my library, but when the package was built one function was omitted from the export commands in the NAMESPACE file. I was hoping that I could simply add another line to the file but it appears that the namespace definitions, despite being in a text file, are 'baked in' to the package at build time. I've tried both adding and removing export comman

我可以在不重建包的情况下编辑NAMESPACE文件吗?

我的库中有一个现有的包,但是在构建包时, NAMESPACE文件中的export命令中省略了一个函数。 我希望我可以简单地在文件中添加另一行,但看起来名称空间定义尽管处于文本文件中,但在构建时“包含”到包中。 我已经尝试添加和删除export命令,但加载的名称空间列表不会更改。 我已经确保分离和卸载有问题的软件包,然后重新启动R (3.3.1)clean。 那么,我是否必须重建,还是错过了一些简单的步骤? (对于那些想知道的,

Elegant way to check for missing packages and install them?

I seem to be sharing a lot of code with coauthors these days. Many of them are novice/intermediate R users and don't realize that they have to install packages they don't already have. Is there an elegant way to call installed.packages() , compare that to the ones I am loading and install if missing? Yes. If you have your list of packages, compare it to the output from installed.pac

优雅的方式来检查丢失的包并安装它们?

我似乎近期与共同作者分享了很多代码。 他们中的许多人都是新手/中级R用户,并没有意识到他们必须安装他们尚未拥有的软件包。 有没有一种优雅的方式来调用installed.packages() ,比较那些我加载和安装,如果失踪? 是。 如果您有软件包列表,请将其与installed.packages()[,"Package"]的输出进行比较,然后安装缺失的软件包。 像这样的东西: list.of.packages <- c("ggplot2", "Rcpp") new.packages <-

How do I install an R package from source?

A friend sent me along this great tutorial on webscraping NYtimes with R. I would really love to try it. However, the first step is to installed a package called RJSONIO from source. I know R reasonably well, but I have no idea how to install a package from source. I'm running Mac OSX. If you have the file locally, then use install.packages() and set the repos=NULL : install.packages(

我如何从源代码安装R包?

一位朋友给我发了一篇关于在纽约时报网站上用R写的伟大教程。我真的很喜欢尝试它。 但是,第一步是从源代码安装一个名为RJSONIO的包。 我非常了解R,但我不知道如何从源代码安装软件包。 我正在运行Mac OSX。 如果你有本地文件,那么使用install.packages()并设置repos=NULL : install.packages(path_to_file, repos = NULL, type="source") 其中path_to_file代表完整路径和文件名: 在Windows上它看起来像这样: &q

Detach several packages at once

Inspired by this answer I am looking for a way to detach several packages at once. When I load say Hmisc, # install.packages("Hmisc", dependencies = TRUE) require(Hmisc) R also loads survival and splines . My question is if there is a way to unload that group together? I currently do something like this, detach(package:Hmisc, unload = T) detach(package:survival, unload = T) detach(packa

一次分离几个软件包

受到这个答案的启发,我正在寻找一种方法来一次分离几个软件包。 当我装载Hmisc时, # install.packages("Hmisc", dependencies = TRUE) require(Hmisc) R还加载survival和splines 。 我的问题是,如果有办法一起卸载这个组? 我目前正在做这样的事情, detach(package:Hmisc, unload = T) detach(package:survival, unload = T) detach(package:splines, unload = T) 我试过了, detach(package:c('Hmisc', 'surviva

rm(list=ls()) doesn't completely clear the workspace

This is a very minor issue, but I would like to understand exactly what is going on here. Say I do the following: library(RMySQL) con <- dbConnect(MySQL(), host="some.server.us-east-1.rds.amazonaws.com",user="aUser", password="password", dbname="mydb") values1 <- dbGetQuery(con,"select x,y from table1") attach(values1) At this point, I can do rm(list=ls()) values2 <- dbGetQuery("s

rm(list = ls())不会完全清除工作区

这是一个非常小的问题,但我想明确地知道这里发生了什么。 假设我执行以下操作: library(RMySQL) con <- dbConnect(MySQL(), host="some.server.us-east-1.rds.amazonaws.com",user="aUser", password="password", dbname="mydb") values1 <- dbGetQuery(con,"select x,y from table1") attach(values1) 在这一点上,我可以做到 rm(list=ls()) values2 <- dbGetQuery("select x,y from table1") attach(values2)

Stargazer R Package: Position of Title in Latex Table

I am using the stargazer Package in r to produce summary statistics for latex documents. However, the function produces latex code with the title (caption) on top of the table. Is is there an easy way to put the title below the table? require(stargazer) df <- data.frame(a=c(1,2,3), b=c(2,3,5), c=c(8,8,9)) stargazer(df,summary = TRUE, type = "latex",

Stargazer R包装:标题在乳胶表中的位置

我使用r中的stargazer Package生成胶乳文档的汇总统计信息。 但是,该函数会在表格顶部生成标题(标题)的乳胶代码。 是否有简单的方法把标题放在桌子下面? require(stargazer) df <- data.frame(a=c(1,2,3), b=c(2,3,5), c=c(8,8,9)) stargazer(df,summary = TRUE, type = "latex", title = "summary statistic") 该函数的输出如下所示: begin{table}[!htbp] centering

R: Creating Latex tables without environment code

How can I print latex-formatted tables (eg summary statistics, no regression output) in R, but without the environment code like begin{table}[!htbp] centering ? I tried many packages listed in Tools for making latex tables in R. Only the stargazer package seems to have an option for suppressing Latex environment code, namely out.header=FALSE . But that option seems to have no effect. Other pa

R:创建没有环境代码的乳胶表

如何在R中打印latex格式的表(例如汇总统计信息,无回归输出),但没有像begin{table}[!htbp] centering这样的环境代码? 我尝试了许多在R中用于制作乳胶表的工具中列出的软件包。只有stargazer软件包似乎可以选择抑制Latex环境代码,即out.header=FALSE 。 但是这个选择似乎没有效果。 其他软件包似乎更少选择。 背景:我有两张非常相似的表格(在我的情况下是spearman和pearson相关),我希望在Latex的一个表格中有这种

Getting standard errors for lme4 object with texreg

I've been using the fantastic package texreg to produce high-quality HTML tables from lme4 models. Unfortunately, by default, texreg creates confidence intervals, rather than standard errors, under the coefficients for models from lme4 (see page 17 of the JSS paper). As an example: library(lme4) library(texreg) screenreg(lmer(Reaction ~ Days + (Days|Subject), sleepstudy)) produces Compu

使用texreg获取lme4对象的标准错误

我一直在使用梦幻般的包texreg来从lme4模型中生成高质量的HTML表格。 不幸的是,默认情况下,texreg在lme4模型的系数下创建置信区间,而不是标准误差(参见JSS论文第17页)。 举个例子: library(lme4) library(texreg) screenreg(lmer(Reaction ~ Days + (Days|Subject), sleepstudy)) 产生 Computing profile confidence intervals ... Computing confidence intervals at a confidence level of 0.95. Use argument "met

Regression tables in Markdown format (for flexible use in R Markdown v2)

The new version of R Markdown is based on pandoc, so you can easyly change the output format. My Problem is to get markdown formated tables from eg regression models, because LATEX and HTML tables do not survive the pandoc conversion. I know packages that generate LATEX/HTML output from a variety of models (stargazer, texreg, asprtable...) and I'm aware of functions/packages, that generat

Markdown格式的回归表格(适用于R Markdown v2)

R Markdown的新版本基于pandoc,因此您可以轻松更改输出格式。 我的问题是从回归模型中获得降格表格,因为LATEX和HTML表格无法在pandoc转换中生存。 我知道从各种模型(stargazer,texreg,asprtable ...)生成LATEX / HTML输出的包,并且我知道函数/包,它们会根据数据框和矩阵生成降价表,但不能从其他对象生成降价表。 有什么建议么? 我上面的更多细节评论: 为可重现的例子定义一些模型: lm0 <- lm(hp ~ wt,