我一直在清理我的目录,并注意到每个Meteor.js项目至少占用77MB(通常更像是150MB)!为了弄清楚发生了什么,我继续创建了一个新应用:
meteor create myapp
Run Code Online (Sandbox Code Playgroud)
此时,该文件夹占用大约7kb.但是在我这样做之后
cd myapp
meteor
Run Code Online (Sandbox Code Playgroud)
文件夹大小最大为77MB.
经过一番挖掘,我设法精确地增加了.meteor/db文件夹的大小.更具体地说,运行应用程序会创建这些local*文件.meteor/db,每个文件大于16Mbs.我打开了这些,它们主要只是一长串0000s,其中有几个非0000s.如果我开始做更多 - 添加数据,Meteor.collections等等 - 大小气球达到100 + MB.
我的问题
我正在使用plotly它r来生成一些子图.玩具示例如下所示.
library(shiny)
library(dplyr)
library(plotly)
## Toy Example
ui <- fluidPage(
h3("Diamonds"),
plotlyOutput("plot", height = 600)
)
server <- function(input, output, session) {
# reduce down the dataset to make the example simpler
dat <- diamonds %>%
filter(clarity %in% c("I1", "IF")) %>%
mutate(clarity = factor(clarity, levels = c("I1", "IF")))
output$plot <- renderPlotly({
# Generates the chart for a single clarity
byClarity <- function(df){
Clarity <- df$clarity[1];
plot_ly(df, x = ~carat, y = ~price, color = ~cut, name …Run Code Online (Sandbox Code Playgroud) 我似乎无法ggparcoord使用离散比例来绘制颜色.当我这样做:
ggparcoord(data = iris, columns = 1:4, groupColumn = "Species")
Run Code Online (Sandbox Code Playgroud)
输出图仍然使用连续比例(使用Species因子的级别)对线条着色.
我也尝试过scale_color_manual这里指定技巧的修改版本:控制ggparcoord中的颜色,但无济于事.
ggparcoord(data = iris, columns = 1:4, groupColumn = "Species") +
scale_color_manual(values = c("setosa" = "red",
"versicolor" = "green",
"virginica" = "blue"))
Run Code Online (Sandbox Code Playgroud)
但我收到此错误消息:Error: Continuous value supplied to discrete scale.
我也尝试过.. + scale_color_discrete():同样的错误信息.
我很难过 ......即使ggparcorod cran页面上的例子都不起作用:
data(diamonds, package="ggplot2")
diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],100),]
ggparcoord(data = diamonds.samp,columns = c(1,5:10),groupColumn = 2)
Run Code Online (Sandbox Code Playgroud)
错误信息: Error: (list) object cannot be coerced …
有没有过滤的方法中 ggplot本身?也就是说,我想这样做
p <- ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, species)) +
geom_point(size = 4, shape = 4) +
geom_point(size = 1, shape = 5 # do this only for data that meets some condition. E.g. Species == "setosa")
Run Code Online (Sandbox Code Playgroud)
我知道我可以使用hacks,如设置size = 0,如果Species != "setosa"或重置数据,如下所示,但有所有hacks.
p <- ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length, species)) +
geom_point(size = 4, shape = 4) +
geom_point(data = iris %>% filter(Species == "setosa"), colour = "red") +
geom_point(data = …Run Code Online (Sandbox Code Playgroud)