केस स्टडीज़: R में Shiny के साथ वेब एप्लिकेशन बनाना
Dean Attali
Shiny Consultant
नए डेटासेट को एक्सप्लोर करते समय plots आम पहला कदम होते हैं
plotOutput("my_plot")
output$my_plot <- renderPlot({
# code for a plot
})
Downloading, download बटन से सपोर्टेड है

Comma Separated Values
छोटे-मध्यम डेटासेट स्टोर करें
gapminder का CSV:
country,continent,year,lifeExp,pop,gdpPercap
Afghanistan,Asia,1952,28.801,8425333,779.4453145
Afghanistan,Asia,1957,30.332,9240934,820.8530296
Afghanistan,Asia,1962,31.997,10267083,853.10071
Afghanistan,Asia,1967,34.02,11537966,836.1971382
CSV फ़ाइल बनाएँ:
write.csv(gapminder, "myfile.csv")
Download बटन को आउटपुट माना जाता है
downloadButton(outputId = "download_data",
label = "Download data")
output$download_data <- downloadHandler(
filename = "data.csv",
content = function(file) {
# Code that creates a file in the path <file>
write.csv(gapminder, file)
}
)
output$download_data <- downloadHandler(
filename = "data.csv",
content = function(file) {
# code that creates a file in the path <file>
write.csv(gapminder, file)
}
)
downloadHandler() के दो आर्ग्यूमेंट होते हैंfilenamecontent(file)केस स्टडीज़: R में Shiny के साथ वेब एप्लिकेशन बनाना