Posts

Showing posts from February, 2017

Web page static elements using R Studio

Image
We have seen that R Studio can be used to create Web Page using the 'Shiny' package. One of the first things to do is to create web content in HTML that can be rendered n a browser.

You can use a HTML wrapper function or use the individual wrapper functions of the various tags in formatting a web page. In most of the examples you can directly copy the code and paste it into the R studio console.

Here is an example of how you may wrap with HTML:

library(shiny)
ui <-fluidpage br="">  HTML(" Test ")
)
server <-function br="" input="" output="">
shinyApp(ui=ui, server=server)

This is how it gets rendered.


Static_00

In the following there are few more tags that are frequently used. I will try to get all of them in future posts.

Here are the tags a, h1 and br.

library(shiny)

ui <-fluidpage b="">a (href="http://hodentek.blogspot.com",h1("Hodentek")),
br(),a(href="http://hodentekMSSS.blogspot.com…

Workaround for this error in R Studio

Image
You started your learning and some times you encounter this error in your RStudio console:

ERROR: [on_request_read] connection reset by peerWhat are you going to do?
What is described here is not a complete fix (unless you want to change your default browser)but a possible explanation of what is happening. It is most probably related to RStudio using the Microsoft Edge in Windows 10 operating system.

There are three modes that you can run to display in a viewer. This are shown in this image here:


ShinyError_000.png

Run in Window mode:

Run in Window opens a window ~ -Shiny as shown and runs the highlighted code to display the result.


ShinyError_00.PNG

Notice that the tab that is open is http://127.0.01:6170. Now if you change over the tab to 'Open in Browser', Microsoft Edge opens displaying the same URL. Now if you close the browser you see the error messages as shown. I am not sure why it repeats so many times.


ShinyError_02.PNG

However, if you copy the URL (http://127.0.0…

Building Web apps with R Language - Part 1

Image
R language is open source with a huge number of developers. It has a great arsenal of great stuff already accomplished. It is a language that you should get exposed to yourself. You just install R Gui and you are ready.

Shiny is an enterprise-grade web application framework targeted for those who want to develop with R using the familiar HTML5, CSS and JavaScript. Using R you can turn terrific analytic solutions you have developed/developing into interactive web applications.

Go to this site (https://shiny.rstudio.com/) directly and learn more.

Rshiny-00

If you have R Studio you have Shiny because Shiny is a package that you can download.

In this first part we only talk about the very basics.

I assume you have read my previous hands-on R examples in my blogs.

http://hodentekhelp.blogspot.com/2015/09/what-is-good-way-to-learn-r-language.html
http://hodentekhelp.blogspot.com/search?q=R+language

Here I just show a very basic (aka Hello World) example of creating content for a web p…

Before you create a database based app on Appery.io read this

Image
In creating a mobile app based on back-end data in Appery.io, server code that accesses a collection can be used as shown here.

In this post we start with a collection we created by importing a CSV file, FFD.csv.

We now create a Server Side script to access this collection.

In the appery.io platform  click on Server Code tab to open the user interface as shown.  In the script editor there may be some default code. Remove this script.



ApperyIO7_00.PNG

From the Snippets side click and add Retrieve all Objects. This inserts a line of code into the editor as shown below:

var result = Collection.query("dbId", "collectionName"); 
You need to insert correct values for the arguments. The JsonTest was the database in which the imported collection was saved. The imported CSV file was named as a collection with the name 'Custo'. The dbId parameter was found from the Settings tab for the JsonTest database

ApperyIO7_02.PNG

If the script is properly formulated you could…

Building a jQuery Mobile App with back-end data using Appery.IO

Image
Apps without data are not very useful. Appery.io provides a platform to build apps with ease. Integrating with back-end data is as easy.

The example in this post is the same as the example at Appery.IO site although some names are different. You may find more details (screen shots) than at the Appery.io site.



Here are steps to create apps which takes in data from the database.

Creating the App
Designing the APP UI
Import the Server Code script

Mapping the Service to the UI
Invoking the Service
Testing the app

Go to Apps on Appery.io platform. Create a new App called Bigbox.


ApperyIO5_00

Choose new blank template using jQuery Mobile in Create new app window.


ApperyIO5_01.PNG

Bigbox project page opens.
-------------

Designing the APP UI

Click Open Pages and click on startScreen.


ApperyIO5_03.PNG

The startScreen header is now reading Caption, the same in the Properties -Header window as shown.


ApperyIO5_04.PNG

Change Caption to My App in the Proprieties - Header. The startScreen header also changes.

Dr…

Importing sample text into Appery.io

Image
Web based appery.io has both front-end designer as well as back-end database support for both relational and NoSQL databases. The front-end can be used to create mobile apps, both web and hybrid applications. For creating a simple app to look at data from the back-end, a sample data can be prepared by importing a text files saved as a CSV file.

Appery.io supports importing data files in CSV or JSON formats. In this post you will learn the procedure to import a CSV text file.

The file we are going to import is FFD.CSV saved on the files/folders of the local computer which has been imported recently into other data sources such as MS Access 2016 here and here; SAP SQL Anywhere 17; and Power BI. The data file is created by exporting the data from a Query on SQL Server 2012 using the Export/Import Wizard.

Log in to Appery.io and Click on Databases tab.

ApperyIO4_0.PNG

There are already two databases under my account. Click Create new database.

Create new database window appears. Insert na…

Using a relational database with Apppery.io

Image
In a previous post creating a back-end NoSQL database on the Appery.io platform was described. Herein attempting to connect to a SQL Server 2012 is described.

It is quite straight forward connecting to a relational database.

Here is the procedure described on the site:

Login to the Appery.io site and click on API Express tab.

ApperyIO3_0.PNG

The API Express page opens as shown.


ApperyIO3_1.PNG

In this case we just make a connection to SQL Server 2012. Make sure you have started SQL Server from Windows Services panel.

Click Create new DB connection.
The New connection page is displayed.


ApperyIO3_2.PNG

Provide a Name and click Create. It looks like you can also connect to a backup.
Page related to the connection name you provided opens (herein SQL2k12).



ApperyIO3_2.PNG

Fill in all the fields needed to make connection.

Connection name: SQL2k12
Connection type: Relational database (the other option is appery.io database)
Database type: SQL Server
Host: Hodentek\RegencyPark
Port: 1433 (default)