How to embed weather API into shinydashboards

允我心安 提交于 2021-02-11 14:06:52

问题


I am creating shiny dashboard that will have various information. One of the things that I am trying to implement is to have a section in the app for weather. I am learning shiny dashboard on the go. This in fact is my first shiny app. So in order to learn this I googled how to get weather into shiny dashboards. I came upon on a similar question here on stack overflow here and found out how a guy got boston weather into his app. I was able to mimic his code and in my shiny dashboard get the weather for boston. However I want the weather for Vienna Austria. so I basically took his code:

                tabName = "dashboard",
                fluidRow(
                    tags$iframe(
                        seamless = "seamless", 
                        src = "https://forecast.io/embed/#lat=42.3583&lon=-71.0603&name=Downtown Boston", 
                        height = 800, width = 1400
                    )
                )
            )

and tried to change the latitude and longitude coordinates and the name. Here is the code:

      fluidRow(
        tags$iframe(
          seamless = "seamless",
          src = "https://forecast.io/embed/#48.2205998&lon=16.2399771&name=Vienna",
          height = 800,
          width = 1400
        )
      )
    )

This of course didn't work and I got back as a result invalid location. I tried to go to the dark sky website and see if I need to register with them to get a personal key and other information but they said they are not accepting new registrations. I have tried googling other ways to put in weather but I cant find much on how to do this.


回答1:


You made a mistake with the format:

https://forecast.io/embed/#lat=48.2205998&lon=16.2399771&name=Vienna


来源:https://stackoverflow.com/questions/62383308/how-to-embed-weather-api-into-shinydashboards

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!