我收到错误说:
**ERROR: C:\Users\user\Desktop\practice_4/app.R:59:32: unexpected INCOMPLETE_STRING
58: tabItem(tabName = "signup",
59: textInput("name", "
^**
当我没有使用shinyDashboard库时,我能够成功运行相同的代码。根据我到目前为止发现的内容,它看起来像sys.locale()
错误(有人问过类似的问题:"unexpected INCOMPLETE_STRING" error when printing Chinese word)。
当我运行sessionInfo()
时,我得到以下结果:
R version 3.1.1 (2014-07-10)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=Korean_Korea.949 LC_CTYPE=Korean_Korea.949 LC_MONETARY=Korean_Korea.949
[4] LC_NUMERIC=C LC_TIME=Korean_Korea.949
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_2.1.0 googleVis_0.5.10 xtable_1.8-2 shinyjs_0.6
[5] shinydashboard_0.5.1 shiny_0.13.2
loaded via a namespace (and not attached):
[1] colorspace_1.2-6 digest_0.6.9 DT_0.1 grid_3.1.1 gtable_0.1.2 htmltools_0.3.5
[7] htmlwidgets_0.6 httpuv_1.3.3 jsonlite_0.9.19 magrittr_1.5 mime_0.3 miniUI_0.1.1
[13] munsell_0.4.2 plyr_1.8.3 R6_2.1.2 Rcpp_0.11.5 RJSONIO_1.3-0 scales_0.4.0
[19] tools_3.1.1 yaml_2.1.13
我尝试按如下方式设置sys.locale但没有成功:
Sys.setlocale("LC_TIME", "ko_KR.UTF-8")
Sys.setlocale("LC_CTYPE", "ko_KR.UTF-8")
Sys.setlocale("LC_COLLATE", "ko_KR.UTF-8")
Sys.setlocale("LC_MONETARY", "ko_KR.UTF-8")
Sys.setlocale("LC_MESSAGES", "ko_KR.UTF-8")
这是我的ui.R代码:
body<- dashboardBody(
actionButton("showSidebar", "Show sidebar"),
actionButton("hideSidebar", "Hide sidebar"),
tabItems(
tabItem(tabName = "leaderboard",
h2="Leaderboard content goes here.",
dataTableOutput("content")),
tabItem(tabName = "stats",
h2="stats goes here.",
fluidRow(
column(5,
hr(),
verbatimTextOutput("summa1")),
column(4,
hr(),
uiOutput("summa2")),
column(4,
hr(),
uiOutput("summa3")))),
tabItem(tabName = "signup",
textInput("name", "이름"), # this is where error occurs
selectInput("college", "대학",choices = list("간호대학", "경영대학",
"공과대학", "농업생명과학대학",
"미술대학", "법과대학",
"사범대학", "사회과학대학",
"수의과대학", "생활과학대학",
"약학대학", "음악대학",
"인문대학", "의과대학",
"자연과학대학", "기타"),
selected = 1)))
答案 0 :(得分:0)
我使用日语,但是在导入文件的过程中,我为所有导入提供了带有编码的源
source("constants.R",encoding = "UTF-8")
并使用file>save_with_encoding