无法在R 3.0.2上安装闪亮包

 qin2112 发布于 2023-01-29 09:07

我正在使用Win64并且无法在R上安装"闪亮"软件包.在尝试安装时,将填充以下消息.有人可以把我放在正确的轨道上,还是我错过了一些真正愚蠢的东西?

> install.packages("shiny")
Installing package into ‘C:/Users/Ayan/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: unable to access index for repository http://ftp.iitm.ac.in/cran/bin/windows/contrib/3.0
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.0
Warning messages:
1: In open.connection(con, "r") : unable to resolve 'cran.r-project.org'
2: package ‘shiny’ is not available (for R version 3.0.2)

我尝试使用India,Cloud(0)作为CRAN镜像

ui.R文件的内容:

library(shiny)

# Define UI for application that plots random distributions 
shinyUI(pageWithSidebar(

# Application title
 headerPanel("Hello Shiny!"),

  # Sidebar with a slider input for number of observations
  sidebarPanel(
    sliderInput("obs", 
            "Number of observations:", 
            min = 1,
            max = 1000, 
            value = 500)
  ),

  # Show a plot of the generated distribution
  mainPanel(
    plotOutput("distPlot")
  )
))

server.R文件的内容:

    library(shiny)

    # Define server logic required to generate and plot a random distribution
shinyServer(function(input, output) {

  # Expression that generates a plot of the distribution. The expression
  # is wrapped in a call to renderPlot to indicate that:
  #
  #  1) It is "reactive" and therefore should be automatically 
  #     re-executed when inputs change
  #  2) Its output type is a plot 
  #
  output$distPlot <- renderPlot({

    # generate an rnorm distribution and plot it
        dist <- rnorm(input$obs)
        hist(dist)
      })
    })

我也面临着为分类问题安装包'holdOut'的问题.这就是它所显示的:

> install.packages("holdOut")
Installing package into ‘C:/Users/Ayan/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘holdOut’ is not available (for R version 3.0.2)

这两个问题有关吗?

1 个回答
  • 尝试:

    options(repos = c(CRAN = "http://cran.rstudio.com"))
    install.packages('shiny')
    

    2023-01-29 09:10 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有