Book Image

Learning Shiny

By : Hernan Resnizky
Book Image

Learning Shiny

By: Hernan Resnizky

Overview of this book

Table of Contents (19 chapters)
Learning Shiny
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Introducing R, RStudio, and Shiny
Index

Creating UIs from plain HTML


UIs from plain HTML, require firstly that the HTML file is stored in the www folder and secondly, that the file is named as index.html. Naturally, creating a whole interface in HTML without any of Shiny's UI functionality requires considerable experience in web programming. For this reason, in this section, we are going to reproduce Example 1 only, but with an HTML file instead of an UI.R file.

In order to do this, create a copy of Example 1 folder as follows:

  1. Copy the following code and paste it in a text editor. You are strongly recommended to use text editors that support syntax highlighting. Probably, the best option is Notepad++, which is accessible from https://notepad-plus-plus.org/. Save the file as index.html in the www folder that will be created in step 2.

  2. Inside the new folder, create the www folder:

    <!DOCTYPE html>
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <script type="application...