library(shiny)
library(stringr)
library(inpi)
library(dplyr)
shinyServer(function(input, output, session) {
output$resultado <- renderTable({
re <- input$pesquisa
if(is.character(re) & str_length(re) > 3) {
result <- pesquisa_inpi(re, xml = xml)
distinct(result)
}
})
output$resultado_txt <- renderText({
re <- input$pesquisa
if(is.character(re) & str_length(re) > 3) {
result <- pesquisa_inpi(re, xml = xml, mostrar_ncl = FALSE)
n <- length(result)
if(n == 0) {
txt <- 'A pesquisa nao gerou nenhum resultado'
} else if(n == 1) {
txt <- 'A pesquisa gerou um resultado'
} else {
txt <- sprintf('A pesquisa gerou %d resultados', n)
}
txt
}
})
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.