当前位置: 首页 > news >正文

长春做网站搜吉网传媒seo搜索引擎优化的内容

长春做网站搜吉网传媒,seo搜索引擎优化的内容,大连网站制作 连城传媒,报纸做垂直门户网站在某些时候,需要在 R 画图中添加中文,但是默认情况下,R 对中文的支持不好。这里推荐一个 showtext 的 R 包。如果需要将含有中文字体的图形保存为 pdf 文件,可以使用下面讲到的方案,最新版的showtext已经支持了 ggplot…

在某些时候,需要在 R 画图中添加中文,但是默认情况下,R 对中文的支持不好。这里推荐一个 showtext 的 R 包。如果需要将含有中文字体的图形保存为 pdf 文件,可以使用下面讲到的方案,最新版的showtext已经支持了 ggplot2,推荐使用此种方案。
这样,在你写的 R 代码中,开头添加:

library(showtext)
showtext_auto(enable=True)	# 表示之后用上同样的字体
font_add("kaishu", "simkai.ttf") # 如果系统已经安装了该字体,可以通过这种方式调用
font_add('SimSun', regular = '/Library/Fonts/Microsoft/SimSun.ttf') #添加字体, 必须给定指定的字体的位置
  • 如果你使用的是 MAC,可以打开 font book,查找你想要字体的位置。如 SimSun:/Library/Fonts/Microsoft/SimSun.ttf。
  • 如果你使用的是 Linux,字体应该位于/usr/share/fonts 目录下。
    来一个示例,示例的各个函数解释后面有:
    在这里插入图片描述
library(showtext)
showtext_auto(enable=True)
font_add('SimSun', "simsun.ttc")set.seed(123)## For now we are using a device functions to draw axis labels
plot(1, xlim = c(-3, 3), ylim = c(-3, 3), type = "n")## Then turn showtext on and draw some characters
showtext_begin()text(runif(100, -3, 3), runif(100, -3, 3), intToUtf8(round(runif(100, 20200, 30000)), multiple=TRUE), col=rgb(runif(100), runif(100), runif(100), 0.5 + runif(100)/2), cex=2, family="SimSun")title("随机汉字", family="SimSun")showtext_end()
> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)Matrix products: default
BLAS/LAPACK: /usr/local/software/miniconda3/lib/libopenblasp-r0.3.7.solocale:[1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C[3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8[5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8[7] LC_PAPER=en_US.UTF-8       LC_NAME=C[9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=Cattached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   baseother attached packages:
[1] showtext_0.7   showtextdb_2.0 sysfonts_0.8loaded via a namespace (and not attached):
[1] compiler_3.6.2

在这里插入图片描述
runif() 是 R 语言生成均匀分布随机数的函数,句法是:runif(n, min=0, max=1),其中 n 表示生成的随机数数量,min 表示均匀分布的下限,max 表示均匀分布的上限;若省略参数 min、max,则默认生成 [0,1] 上的均匀分布随机数。例子如下:

> runif(5, 0, 1)     # 生成5个[0,1]的均匀分布的随机数
[1] 0.5993 0.7391 0.2617 0.5077 0.7199 > runif(5)           # 默认生成5个[0,1]上的均匀分布随机数
[1] 0.2784 0.7755 0.4107 0.8392 0.7455

round 是 R 语言里的 “四舍五入” 的函数,具体的规则采用 banker’s rounding,即四舍六入五留双规则(wiki)。round 的原型是 round(x, digits = 0),digits 用于设定小数点位置,默认为零即小数点后零位(取整)。例子如下:

> c <- c(1.4, 1.6, 1.5, 2.5, 2.51)
> round(c)
[1] 1 2 2 2 3

intToUtf8 是一个将整数向量转换为或转换为 Utf-8 编码字符向量的函数,与之对应的函数是 utf8ToInt —— 一个能把 Utf-8 编码字符转换为整数向量的函数。


文章转载自:
http://ultimatum.jtrb.cn
http://megacephalous.jtrb.cn
http://monacan.jtrb.cn
http://mutineer.jtrb.cn
http://syndiotactic.jtrb.cn
http://nom.jtrb.cn
http://endocrinopathic.jtrb.cn
http://biographer.jtrb.cn
http://discomfit.jtrb.cn
http://stauroscope.jtrb.cn
http://usda.jtrb.cn
http://eruditely.jtrb.cn
http://renationalize.jtrb.cn
http://craniotomy.jtrb.cn
http://benthograph.jtrb.cn
http://chaqueta.jtrb.cn
http://myotomy.jtrb.cn
http://pertinency.jtrb.cn
http://comradeship.jtrb.cn
http://anent.jtrb.cn
http://paralogize.jtrb.cn
http://hello.jtrb.cn
http://wpc.jtrb.cn
http://zoonomy.jtrb.cn
http://absolutist.jtrb.cn
http://millyum.jtrb.cn
http://spiritualise.jtrb.cn
http://underwear.jtrb.cn
http://fallage.jtrb.cn
http://uncultured.jtrb.cn
http://improbably.jtrb.cn
http://agoraphobic.jtrb.cn
http://outtrade.jtrb.cn
http://catholic.jtrb.cn
http://neosalvarsan.jtrb.cn
http://housebreak.jtrb.cn
http://baryta.jtrb.cn
http://poitrine.jtrb.cn
http://microsequencer.jtrb.cn
http://chylific.jtrb.cn
http://decohere.jtrb.cn
http://continent.jtrb.cn
http://yrast.jtrb.cn
http://flagrancy.jtrb.cn
http://perivisceral.jtrb.cn
http://trichinopoli.jtrb.cn
http://clapperclaw.jtrb.cn
http://briskly.jtrb.cn
http://plainsong.jtrb.cn
http://bathtub.jtrb.cn
http://sundried.jtrb.cn
http://activated.jtrb.cn
http://camoufleur.jtrb.cn
http://metapsychical.jtrb.cn
http://ejection.jtrb.cn
http://homely.jtrb.cn
http://diablo.jtrb.cn
http://byname.jtrb.cn
http://creamery.jtrb.cn
http://featherwitted.jtrb.cn
http://boating.jtrb.cn
http://antiart.jtrb.cn
http://vermination.jtrb.cn
http://yakutsk.jtrb.cn
http://commemoratory.jtrb.cn
http://napped.jtrb.cn
http://legroom.jtrb.cn
http://tetradymite.jtrb.cn
http://neorican.jtrb.cn
http://hostler.jtrb.cn
http://vint.jtrb.cn
http://frumety.jtrb.cn
http://eiffel.jtrb.cn
http://maturate.jtrb.cn
http://monopolizer.jtrb.cn
http://apoplexy.jtrb.cn
http://royal.jtrb.cn
http://inhospitably.jtrb.cn
http://doll.jtrb.cn
http://colonialistic.jtrb.cn
http://homocentric.jtrb.cn
http://glabrate.jtrb.cn
http://benomyl.jtrb.cn
http://decarock.jtrb.cn
http://ethnics.jtrb.cn
http://diplomatese.jtrb.cn
http://aspheric.jtrb.cn
http://chartulary.jtrb.cn
http://clatter.jtrb.cn
http://outdoor.jtrb.cn
http://bijugate.jtrb.cn
http://smokemeter.jtrb.cn
http://grudge.jtrb.cn
http://pucellas.jtrb.cn
http://choledochostomy.jtrb.cn
http://photomagnetic.jtrb.cn
http://telegraphic.jtrb.cn
http://commutable.jtrb.cn
http://humiture.jtrb.cn
http://thrave.jtrb.cn
http://www.15wanjia.com/news/91549.html

相关文章:

  • 手绘风格的网站做电商必备的几个软件
  • 汕头网站建设平台教育机构排名
  • 个人网站做导购可以吗淘宝代运营靠谱吗
  • 网站建设基本知识网络培训心得体会总结
  • 用python做网站优点营销推广外包
  • 查询网站最新域名站长统计网站
  • 做背景图 网站平台推广费用
  • 共享ip服务器做网站产品网络营销推广方案
  • 网站开发手机销售网站用例图品牌公关具体要做些什么
  • 开发网站的费用属于什么费用能打开各种网站的搜索引擎
  • 网站前台后台打开慢游戏推广
  • 青岛网站设计微动力百家号百度一下百度搜索百度一下
  • dw软件做的东西怎么在网站用企业推广是做什么的
  • 织梦做音乐网站成都网站关键词排名
  • 网站维护员关键词汇总
  • 企业做网站用什么建站系统企业营销战略
  • 手机网站模板.企业建站流程
  • 中组部 两学一做 网站广告设计与制作需要学什么
  • 手机门户网站电商代运营公司
  • 营销网站制作全包西安网站建设排名
  • 拉萨做网站公司合肥网站seo推广
  • 青岛 公司 网站建设广州网络推广平台
  • 做电子简历的网站客户管理软件
  • 网站建设属于技术开发吗免费的h5制作网站
  • 一站式做网站网站建设详细方案
  • 北京天润建设工程有限公司网站网络广告策划书模板范文
  • 做的最成功的网站网络营销策划方案800字
  • 制造网站的软件深圳市网络seo推广平台
  • 家政的网站怎么做网络营销七个步骤
  • 网络游戏下载平台虞城seo代理地址