Does R's package support unicode rd file? -
my platform is:
win7 64 rtudio r3.1.3 devtools 1.8.0 rxygen2 4.1.1
i trying make package of own. need describe function unicode. used roxygen2 generate rd file. code simple(i removed real function know how make package):
xxxx means comment made unicode.
#' eastchoice #' @param fn.kind wind xxxxxx #' @param estchoice.path wind #' @return data.frame #' @export #' @examples #' getindbyeastchoice("20150108.csv") getindbyeastchoice <- function(fn.kind){ d <- data.frame(a=c(1,2,3), b=c(4,5,6)) dt <- data.table::data.table(d) }
when check(devtools) r code, failed. following error information given:
* checking pdf version of manual ... warning latex errors when creating pdf version. typically indicates rd problems. latex errors found: ! package inputenc error: unicode char \u8:��<87> not set use latex. see inputenc package documentation explanation. type h <return> immediate help.
at first thought roxygen2 not support unicode other ascii, read rd file generated roxygen2, ok. , use build&reload function(using devtools), suprise, passed.
and add more unicode comment in r file , checked(devtools) again. following:
#' eastchoice xxxxxx #' @param fn.kind wind xxxxx #' @param estchoice.path wind xxxxxxxx #' @return data.frame xxxxxxx #' @export #' @examples #' getindbyeastchoice("20150108.csv") getindbyeastchoice <- function(fn.kind){ d <- data.frame(a=c(1,2,3), b=c(4,5,6)) dt <- data.table::data.table(d) }
it failed expected, other information given , seems more serious:
* checking whether package 'ftools.temp' can installed ... error installation failed. see 'd:/onedrive/program/r.package/ftools.temp.rcheck/00install.out' details.
so checked log:
* installing *source* package 'ftools.temp' ... ** r ** preparing package lazy loading ** *** installing indices wrong in gsub("&", "&", x, fixed = true) : '<86>'multi byte string wrong * removing 'd:/onedrive/program/r.package/ftools.temp.rcheck/ftools.temp'
and time build&load failed.
so think maybe r not support unicode other ascii in rd file? can 1 confirm it? if true, not waste time trying solve problem.
@hrbrmstr thank you. have tried advice. first, added line "encoding:utf-8" in decription file, , saved .r , description coding utf-8 ensure encode correct. , run "check " function, got same error:
strsplit(txt, "\n", fixed = true)���ะพ���: �������ַ���1����utf-8 * checking examples ... ok * checking pdf version of manual ... warning latex errors when creating pdf version. typically indicates rd problems. ����: ��������'"d:/r/r-31~1.3/bin/x64/rcmd.exe" rd2pdf --batch --no-preview --build-dir="c:/users/kanpu/appdata/local/temp/rtmpgfjykw/rd2pdf15f2c22b7768d" --no-clean -o ftools.temp-manual.pdf "d:/onedrive/program/r.package/ftools.temp.rcheck/ftools.temp"'��״̬��1 latex errors found: ! package inputenc error: unicode char \u8:��<97> not set use latex.
the description this:
package: ftools.temp type: package title: try make package version: 0.1 date: 2015-08-25 author: none maintainer: no 1 <none@somewhere.net> description: try make package license: cpl lazydata: true encoding:utf-8 depends: data.table
Comments
Post a Comment