Use R language make webpage(shiny R)
当前位置:以往代写 > R语言教程 >Use R language make webpage(shiny R)
2019-06-13

Use R language make webpage(shiny R)

"shiny R language is extremely easy and fun of a packet it does not need to learn about Web language and how to make a Web page or the like can be achieved using R language for building interactive Web applications.It can make us a more convenient and interactive manner and represent the results, data and models, and even inserted pictures, animation, video and sound and the like, may be said to be very cool!

 

Here's a simple and rapid to realize, you can have my own personal version of a webpage.

If you have not installed the "shiny package, by first installing a pathway,

> install. packages ("shiny")

Provisions of the library (shiny)

In the prior, we may first create a separate folder, for example called "shiny

Then by selecting the Web App Multiple File (ui. / R) of the first step.

Next is the key!

App consists of two parts, one part is ui, i. e.User InterfaceThe other part is,Server function.

whereinuifor controlpagethe layout, serverthen theis a function, used to build or rebuild in the ui in a show ofTheLike.nowIn… don't know it was OK to follow meThewill step – by – stepinletrowSpeakJie.

 

First of all,Theto use the ui is mainly applicable to the netpagethe layout of the basic networkpagethe following layoutFIG.:

((

("title panel"),

(

("sidebar panel"),

(the "main panel")

)

))

ui. R with the function to display a self –dynamic tuningSettinggroupdimensions are adapted to the size ofYou should review, from thegroupPlace in the function, to obtain a whole layout of the app.

while and is the most commonly used elements,over –mostsimplethe uiimplementI am,Themay be obtained on theFIG.The layout.

 

After the layout, IThein different part of the added wantedEastWest.As the basic of the followingContent.

h1 ("Header 1"),

h2 ("Header 2"),

h3 ("Header 3"),

h4 ("Header 4"),

h5 ("Header 5"),

h6 ("Header 6"),

(hr),

(br),

p (strong ("bold"),

p (. lamda.em ("italic"),

p – code ("code"),

p ("Click", (span style = "color: blue", "Here"),

(a) (= "www,". com "," Home ")

ThisInside of the tags is" shiny, IThemay be usednames (tags)We have to see what components may be added, to obtain their desired effect, like the one above.

    in addition to the above – mentioned basic components,"shinyIn some very useful controls available to us, it is often used some of the controls.

# ui. R

 

((

(the "basic control"),

 

(

   

(column 3,

h3 (""),

("action", label = "Action"),

(br),

(br),

("Submit"),

   

(column 3,

h3 (""),

("checkbox", label = "A Choice", value = TRUE)),

(column 3,

(","

label = h3 (""),

choices = list ("Choice 1" = 1,

Choice of "2" = 2, "Choice" 3 "= 3),

selected = 1)),

   

(column 3,

("date",

label = h3 (""),

value = "2014 – 01 – 01")

),

 

(

   

(column 3,

("", label = h3 ("Date range"),

   

(column 3,

("file", label = h3 ("File input"),

   

(column 3,

("action",

label = h3 ("ActionLink"),

The icon ("calendar"),

   

(column 3,

(","

label = h3 (""),

value = 1)

 

),

 

(

   

(column 3,

("radio", label = h3 (""),

choices = list ("Choice 1" = 1, "Choice" 2 "= 2,

"Choice" 3 "= 3), selected = 1)),

   

(column 3,

("select", label = h3 (""),

choices = list ("Choice 1" = 1, "Choice" 2 "= 2,

"Choice" 3 "= 3), selected = 1)),

   

(column 3,

("slider1", label = h3 (""),

min = 0, max = 100, the value = 50),

("slider2", "Law of the People's Republic of China,

min = 0, max = 100, the value c = (25, 75))

),

   

(column 3,

("text", label = h3 (""),

value = "")

)

))

Where () function is added to the content arranged in the same row, the general compound (column) is used.

By these controls, we can realize the many very interesting or cool the contents, the real implementation of the interactive experience.Of course. To realize the interactive experience, it is necessary to define server function, so that when we have mastered the controls to achieve different output result and effect of the specific content and operation will be in my next article.The most basic of these, we are interested can make it on its own.Can actually make it to a favorite web pages, as I help the classmates to achieve a very simple example, the specific URL for https: / / cr – 1314.. io / /.

By the way, we're going to do it on their best firstIntergovernmental Negotiating Committee for an International Legally Binding Instrument for Implementing International Action on Certain Persistent Organic Pollutants. com / products / "shiny – server /

in registration of a Server, then they can define by himself what the name of the website, as well as the need for an insertion picture is required to create a collection of shiny new folder in the folder, the name is available, then the picture is to be put, a call is made (img"The picture name. format").Well, That's it for today's so much more. You can take it upon themselves to implement a simple web page!

 

(In addition, the above advertisement content bit true!!!)

    关键字:

在线提交作业