Update docs/source/r.rst
This commit is contained in:
parent
8fd99bea30
commit
12d891f4ec
|
@ -13,21 +13,15 @@ QuartzMap supports creating of a number of R HTML applications:
|
||||||
.. contents:: Table of Contents
|
.. contents:: Table of Contents
|
||||||
|
|
||||||
|
|
||||||
R Leaflet
|
R Publishing
|
||||||
===================================
|
===================================
|
||||||
|
|
||||||
To create an R Leaflet Map, click on "Add New" button.
|
There are three options for publising your R code.
|
||||||
|
|
||||||
.. image:: images/Add-Map.png
|
|
||||||
|
|
||||||
|
|
||||||
There are three options for creating a Map.
|
|
||||||
|
|
||||||
|
|
||||||
Option 1: FTP.
|
Option 1: FTP.
|
||||||
------------
|
------------
|
||||||
|
|
||||||
FTP Uploads are qgis2web maps you have uploaded directly via FTP.
|
FTP Uploads are R files you have uploaded directly via FTP.
|
||||||
|
|
||||||
It can also maps you uploaded via any FTP client.
|
It can also maps you uploaded via any FTP client.
|
||||||
|
|
||||||
|
@ -44,7 +38,7 @@ Archive is a zipped archive file you can upload.
|
||||||
|
|
||||||
|
|
||||||
Option 3: Paste
|
Option 3: Paste
|
||||||
------------
|
-----------------
|
||||||
|
|
||||||
Paste your R Leaflet code into the code box.
|
Paste your R Leaflet code into the code box.
|
||||||
|
|
||||||
|
@ -52,18 +46,23 @@ Paste your R Leaflet code into the code box.
|
||||||
.. image:: images/R-Paste.png
|
.. image:: images/R-Paste.png
|
||||||
|
|
||||||
|
|
||||||
Options:
|
|
||||||
|
|
||||||
Name
|
R Leaflet
|
||||||
|
===================================
|
||||||
|
|
||||||
|
To create an R Leaflet Map, click on "Add New" button.
|
||||||
|
|
||||||
|
.. image:: images/Add-Map.png
|
||||||
|
|
||||||
|
|
||||||
|
FTP, Upload, or Paste your code.
|
||||||
|
|
||||||
|
Give your R code a Name and Description.
|
||||||
|
|
||||||
|
|
||||||
|
Example
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
Give your map a name. The name will appear as the map title on the dashboard.
|
|
||||||
|
|
||||||
.. image:: images/Name-Desc.png
|
|
||||||
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
The two main components are the libraries and saveWidget function
|
The two main components are the libraries and saveWidget function
|
||||||
|
|
||||||
.. code-block:: R
|
.. code-block:: R
|
||||||
|
@ -136,18 +135,51 @@ An example Choropleth map is included in the installation.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Description
|
|
||||||
--------------
|
|
||||||
|
|
||||||
The Description is the text that will appear at the bottom of the map link
|
|
||||||
|
|
||||||
.. image:: images/Name.png
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
R Plotly
|
R Plotly
|
||||||
===================================
|
===================================
|
||||||
|
|
||||||
|
To create an R Leaflet Map, click on "Add New" button.
|
||||||
|
|
||||||
|
.. image:: images/Add-Map.png
|
||||||
|
|
||||||
|
|
||||||
|
FTP, Upload, or Paste your code.
|
||||||
|
|
||||||
|
Give your R code a Name and Description.
|
||||||
|
|
||||||
|
|
||||||
|
Example
|
||||||
|
--------------
|
||||||
|
|
||||||
|
The three main components are the plotly, ggplot2, and htmlwidgets function
|
||||||
|
|
||||||
|
.. code-block:: R
|
||||||
|
|
||||||
|
# Main libraries for Plotly
|
||||||
|
library(plotly)
|
||||||
|
library(ggplot2)
|
||||||
|
library(htmlwidgets)
|
||||||
|
|
||||||
|
# Your R Code Here
|
||||||
|
|
||||||
|
#saveWidget
|
||||||
|
htmlwidgets::saveWidget(as_widget(p), file="index.html")
|
||||||
|
|
||||||
|
An example of a Plotly app is included in the installation.
|
||||||
|
|
||||||
|
|
||||||
|
.. code-block:: R
|
||||||
|
|
||||||
|
library(plotly)
|
||||||
|
library(ggplot2)
|
||||||
|
library(htmlwidgets)
|
||||||
|
|
||||||
|
set.seed(100)
|
||||||
|
d <- diamonds[sample(nrow(diamonds), 1000), ]
|
||||||
|
p <- plot_ly(d, x=~carat, y=~price, text=~paste("Clarity: ", clarity), mode="markers", color=~carat, size=~carat)
|
||||||
|
htmlwidgets::saveWidget(as_widget(p), file="index.html")
|
||||||
|
|
||||||
|
|
||||||
There are three options for creating a Map.
|
There are three options for creating a Map.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue