我正在gganimate创建一些我想要插入到报告中的.gif文件.我能够保存文件并查看它们,但是,我发现显示的尺寸很小:480x480.有没有办法调整它 - 也许是沿着height和width参数的方式ggsave()?
我可以放大,但这会影响质量,并使我的用例难以理解.
这是一些示例代码:
gplot<- ggplot(gapminder, aes(x = gdpPercap, y = lifeExp, colour = continent,
size = pop, frame = year)) +
geom_point(alpha = 0.6) + scale_x_log10()
gganimate(gplot, "test.gif")
Run Code Online (Sandbox Code Playgroud)
以下是此代码的输出.
部署我的第一个闪亮的应用程序 - 简单的html解析器,让用户上传一个html文件,然后解析它以获取LinkedIn上的分享/提及/喜欢的信息.
该应用程序在本地运行良好(在部署之前进行测试),Rstudio在部署时不会显示任何错误.但是,当我使用shinyapps链接运行它时,似乎上传无法完成,我没有得到任何输出.
它在当地的样子
打开应用程序
正在上传.html文件
在shinyapps.io看起来像什么
我已经编辑了文件名,因为它包含识别信息.
代码如下:
library(rvest)
library(shiny)
ui <- fluidPage(
# theme = "https://bootswatch.com/4/superhero/bootstrap.css",
title = "LinkedIn Report",
fluidRow(
column(12,
fileInput("infile", "Choose .html file",
accept = "text/html", multiple = F) )
),
fluidRow(
column(12,
tableOutput("savedLocation") )
),
fluidRow(
column(12,
tableOutput("parsedData") ),
column(8,
downloadButton("downloadData", "Download"))
)
)
server <- function(input, output){
dd <- reactive(input$infile)
output$savedLocation <- renderTable({
if(is.null(input$infile)){
return(data.frame(Elapsed = character(),
Time = character(),
Name = character(),
Action = character()))
}else{
return(dd())
}
})
actual_data <- …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用库每分钟运行一次脚本taskscheduleR。我按照 GitHub 页面上的示例进行操作,但遇到了以下问题:
taskscheduler_delete("rds_task")不起作用这是我的代码:
taskscheduler_create(taskname = "rds_task",
rscript = "./Testing_Scheduler/testing_scheduler.R",
schedule = "MINUTE",
starttime = format(Sys.time() + 30, "%H:%M"),
startdate = format(Sys.time(), "%d/%m/%Y"),
modifier = 1)
Run Code Online (Sandbox Code Playgroud)
以及内容testing_scheduler.R:
dat <- mtcars
data.table::fwrite(dat[1, ], "./Testing_Scheduler/testfile.txt", append = T)
Run Code Online (Sandbox Code Playgroud)
为了删除任务,我使用了:
taskscheduler_delete("rds_task")
Run Code Online (Sandbox Code Playgroud)
这是不成功的。我最终使用了 Windows 任务计划程序(我的计算机是法语 - 无法更改,抱歉):
与 R 插件的结果相同,只是我似乎能够以这种方式删除任务。我对我的计算机拥有管理员权限(因此这不应该是与访问相关的问题)。
闪亮的新手,似乎还找不到此信息:我正在制作一个带有两个selectInput下拉菜单的应用程序,以便第二个(以黄色突出显示)依赖于第一个。
这是用于数据探索,基本上会遍历不同的文件夹内容。这就是我想要的:
ui <- fluidPage(
selectInput(inputId = "site", label = "Select Site", choices = dir(basepath)),
selectInput(inputId = "duct", label = "Select Duct",
choices = dir(grep(input$site, dir(basepath, full.names = T), val = T)))
)
Run Code Online (Sandbox Code Playgroud)
显然,上面的代码不起作用。我不确定如何input$site在另一个输入功能中使用。
我找到了一些答案:在 R Shiny 中使用 selectinput 函数和在 Shiny ui.R 和 server.R 中使用条件面板显示多个输入框选择多个变量:基于条件的不同 selectInput但它们并不直接适用,因为我没有第一个输入 ( inputId = "site") 的可能选项的详尽列表。