小编Dav*_*alf的帖子

使用 extrafont 将字体导入 R 时,如何解决“无字体名称”问题?

我的 Windows 桌面 ( C:\Users\me\Desktop\Fonts)上有一个文件夹,其中包含我想使用extrafont.

当我尝试使用导入字体时

library(extrafont)
font_import(paths = "C:/Users/me/Desktop/Fonts", prompt=FALSE)
Run Code Online (Sandbox Code Playgroud)

我收到错误消息

Scanning ttf files in C:/Users/me/Desktop/Fonts ...
Extracting .afm files from .ttf files...
C:\Users\me\Desktop\Fonts\arista-light.ttf : No FontName. Skipping.
C:\Users\me\Desktop\Fonts\facebook-letter-faces.ttf : No FontName. Skipping.
C:\Users\me\Desktop\Fonts\Guardian-EgypTT-Text-Regular.ttf : No FontName. Skipping.
C:\Users\me\Desktop\Fonts\pico-black.ttf : No FontName. Skipping.
C:\Users\me\Desktop\Fonts\product-sans.ttf : No FontName. Skipping.
Found FontName for 0 fonts.
Scanning afm files in C:/Users/me/Documents/R/R-3.6.3/library/extrafontdb/metrics
Warning messages:
1: In system2(ttf2pt1, c(args, shQuote(ttfiles[i]), shQuote(tmpfiles[i])),  :
  running command '"C:/Users/me/Documents/R/R-3.6.3/library/Rttf2pt1/exec/ttf2pt1.exe" -a -G fAe "C:\Users\me\Desktop\Fonts\arista-light.ttf" "C:\Users\me\AppData\Local\Temp\RtmpOgbdTh/fonts/arista-light"' had …
Run Code Online (Sandbox Code Playgroud)

r extrafont

8
推荐指数
3
解决办法
1524
查看次数

如何解决引导回归中的“要替换的项目数不是替换长度的倍数”错误?

我正在尝试使用 Andy Field 的教科书Discovering Statistics Using R 中的代码进行引导回归模型。

我正在努力解释运行该boot()函数时收到的错误消息。通过阅读其他论坛帖子,我了解到它告诉我两个对象之间的项目数量不平衡,但我不明白这在我的上下文中意味着什么以及如何解决它。

您可以在此处下载我的数据(Airbnb 列表上的公开数据集)并在下面找到我的代码和完整的错误消息。我使用因子虚拟变量和连续变量的混合作为预测变量。在此先感谢您的帮助!

代码:

bootReg <- function (formula, data, i)
{
d <- data [i,]
fit <- lm(formula, data = d)
return(coef(fit))
}

bootResults <- boot(statistic = bootReg, formula = review_scores_rating ~ instant_bookable + cancellation_policy + 
                  host_since_cat + host_location_cat + host_response_time + 
                  host_is_superhost + host_listings_cat + property_type + room_type + 
                  accommodates + bedrooms + beds + price + security_deposit + 
                  cleaning_fee + extra_people + minimum_nights + …
Run Code Online (Sandbox Code Playgroud)

r

2
推荐指数
1
解决办法
2108
查看次数

标签 统计

r ×2

extrafont ×1