<commit_before>---
exclude_from_search: false
layout: article
title: "Using Algorithmia In Your Shiny App"
categories: sample-apps
tags: [sample-apps]
show_related: false
author: steph_kim
excerpt: "Call Fourier Detrend algorithm in your Shiny app!"
image:
    teaser: /language_logos/r.svg
github: https://github.com/algorithmiaio/sample-apps/tree/master/shiny-r/fourier-detrend-example
---

Before you get started with this Shiny sample app, check out our <a href="{{ site.baseurl }}/clients/r/">Algorithmia R language Client</a> and when you want to work with your own data, read up on [Algorithmia's Data Portal](https://algorithmia.com/data), which offers three different ways to store your data, all available via the [Data API](http://docs.algorithmia.com/#data-api-specification).

Here's a basic example of how to call an algorithm via our REST API inside a Shiny app, which updates the UI based on the API call:


{% include toc.html %}

{% highlight R %}
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
#    http://shiny.rstudio.com/
#

library(shiny)
library(ggplot2)<commit_msg>added link to deployed app<commit_after>---
exclude_from_search: false
layout: article
title: "Using Algorithmia In Your Shiny App"
categories: sample-apps
tags: [sample-apps]
show_related: false
author: steph_kim
excerpt: "Call Fourier Detrend algorithm in your Shiny app!"
image:
    teaser: /language_logos/r.svg
github: https://github.com/algorithmiaio/sample-apps/tree/master/shiny-r/fourier-detrend-example
---

Before you get started with this Shiny sample app, check out our <a href="{{ site.baseurl }}/clients/r/">Algorithmia R language Client</a> and when you want to work with your own data, read up on [Algorithmia's Data Portal](https://algorithmia.com/data), which offers three different ways to store your data, all available via the [Data API](http://docs.algorithmia.com/#data-api-specification).

Here's a basic example of how to call an algorithm via our REST API inside a Shiny app, which updates the UI based on the API call and check out the example on <a href="https://algorithmia.shinyapps.io/fourier-deseasonality/">shinyapps.io</a>:


{% include toc.html %}

{% highlight R %}
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
#    http://shiny.rstudio.com/
#

library(shiny)
library(ggplot2)
{'fraction_non_alphanumeric': 0.10450097847358121, 'fraction_numerical': 0.0007827788649706458, 'mean_word_length': 4.556521739130435, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5383104', 'n_tokens_mistral': 783, 'n_tokens_neox': 764, 'n_words': 301}