我正在使用chart.RollingCorrelation
包中的PerformanceAnalytics
绘制滚动相关性。我想使用“CM Roman”字体作为情节的标题,因为它看起来像乳胶的默认字体。以下代码用于重现错误:
library("extrafont")
library("fontcm")
font_install("fontcm")
loadfonts()
set.seed(2)
x<-ts(rnorm(100), start=c(1,1900))
y<-ts(rnorm(100), start=c(1,1900))
chart.RollingCorrelation(x,y,width=12, ylab="")
title(main= "x and y", family="CM Roman")
我检查过fonts()
注册了“CM Roman”字体。但是,它向我抛出了以下错误:
Warning messages:
1: In title(main = "x and y", family = "CM Roman") :
no font could be found for family "CM Roman"
2: In title(main = "x and y", family = "CM Roman") :
no font could be found for family "CM Roman"
3: In title(main = "x and y", family = "CM Roman") :
no font could be found for family "CM Roman"
有没有想过为什么它会给我这个错误?