我尝试使用 npm 在我的新计算机(在 Windows 10 上)上重新安装我的一个旧 vue 项目,但我遇到了这个错误:
npm ERR! Unexpected end of JSON input while parsing near '...n":"0.8.1","devDepend'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\tmp\empty-npm-cache\_logs\2020-08-09T15_45_53_395Z-debug.log
Run Code Online (Sandbox Code Playgroud)
这是日志文件:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install'
1 verbose cli ]
2 info using npm@6.14.6
3 info using node@v12.18.3
4 verbose npm-session c13f159e6def7ca1
5 silly …Run Code Online (Sandbox Code Playgroud) 我是 R 和 Shiny 的新手,我正在尝试使用 ggplot2 创建一个交互式绘图。当用户选中复选框时,他可以访问多选字段来自定义绘图。
原始数据框包含标识为"N/A"inPublisher和Yearcolumn 的缺失值。我删除了包含 NAs 的行,complete.cases所以它不应该有任何 NA 剩下。
我运行我的应用程序:好的。我进入默认情节:好的。我选中复选框:Warning: Factor 'Publisher' contains implicit NA, consider using 'forcats::fct_explicit_na'
我想删除这个警告,至少理解它。如果您有任何其他评论,请这样做:我的目标是变得更好。
应用程序R:
df<-read.csv("vgsales.csv")
df$Year[df$Year=="N/A"]<-NA
df$Year<-factor(df$Year)
df$Publisher[df$Publisher=="N/A"]<-NA
df$Publisher<-factor(df$Publisher)
df<-df[complete.cases(df),]
pubSales<-na.omit(df
%>% group_by(Publisher, Year)
%>% summarise(Global_Sales=sum(Global_Sales))
)
pubSales<-pubSales[order(pubSales$Year),]
top5Pub<-head(unique(pubSales[order(-pubSales$Global_Sales),]$Publisher),5)
ui <- navbarPage("Video Games Sales",
tabPanel("Publishers",
mainPanel(
titlePanel(
title = "Publishers sales"
),
sidebarPanel(
radioButtons(
"pubOptions",
"Options",
c("Top 5 Publishers"="topFivePub",
"Custom Publishers"="customPub"),
selected="topFivePub"
),
uiOutput("customPubUI")
),
mainPanel(
plotOutput("pubPlot")
),
width=12
)
) …Run Code Online (Sandbox Code Playgroud)