Articles by R on Thomas Roh

Awesome Marker Legends in Leaflet

October 28, 2021 | R on Thomas Roh

The awesome-markers plugin that ships with the leaflet package provides a great way to add iconography to points on a map. Three different icon libraries are supported, you have the ability to change to a few different options for the marker colors: , and can specify the icon color (it’s ...
[Read more...]

Fast SQL Server Imports with R

August 8, 2021 | R on Thomas Roh

Writing large datasets to SQL Server can be very slow using the DBI package with an odbc connection. The issue with writing data is that individual INSERT statements are generated for each row of data. I’ve also had issues with remote connections...
[Read more...]

Shiny in Production: Database Transactions

June 10, 2021 | R on Thomas Roh

An important aspect of maintaining databases with an application interface is to ensure atomicity. When performing multiple writes on a database, any failures that occur during the operations should not violate any logical rules. The most common analogy is a financial transaction. If person A withdraws X dollars from their ...
[Read more...]

Introduction to leaflegend

February 3, 2021 | R on Thomas Roh

leaflegend is a package to extend the customization of legends for the leaflet package in R. The addLegend function provides some great out of the box legends based on the internal palette functions, but styling of the legend components has to be done ... [Read more...]

Introduction to leaflegend

February 3, 2021 | R on Thomas Roh

leaflegend is a package to extend the customization of legends for the leaflet package in R. The addLegend function provides some great out of the box legends based on the internal palette functions, but styling of the legend components has to be don...
[Read more...]

Shiny in Production: App and Database Syncing

August 21, 2020 | R on Thomas Roh

When using shiny in production, often you will want to have some sort of database interactions for storing and accessing data. The DBI package provides an easy way to do the database interactions with a variety of SQL database flavors. In this example, I’m going to use a SQLite ... [Read more...]

Shiny: Add/Removing Modules Dynamically

February 10, 2020 | R on Thomas Roh

Introduction Shiny modules provide a great way to organize and container-ize your code for building complex Shiny applications as well as protecting namespace collisions. I highly recommend starting with the excellent documentation from Rstudio. In thi... [Read more...]

Shiny: Add/Removing Modules Dynamically

February 10, 2020 | R on Thomas Roh

Introduction Shiny modules provide a great way to organize and container-ize your code for building complex Shiny applications as well as protecting namespace collisions. I highly recommend starting with the excellent documentation from Rstudio. In this post, I am going to cover how to implement modules with insertUI/removeUI so ... [Read more...]

SQL Server Schemas & R Tip

October 18, 2019 | R on Thomas Roh

I ran into an issue the other day where I was tring to write a new table to a SQL Server Database with a non-default schema. I did end up spending a bit of time debugging and researching so I wanted to share for anyone else that runs into the ... [Read more...]

SQL Server Schemas & R Tip

October 18, 2019 | R on Thomas Roh

I ran into an issue the other day where I was tring to write a new table to a SQL Server Database with a non-default schema. I did end up spending a bit of time debugging and researching so I wanted to share for anyone else that runs into the ...
[Read more...]

Shiny App: Drive Time Isochrones

November 4, 2018 | R on Thomas Roh

The Open Source Routing Machine project is an excellent resource for computing routing and travel time estimates for road networks. It is an open source library that has a demo server to run API requests to. I’ll only be using one of the services (isochrones which I’ll explain ... [Read more...]

Shiny Gadget: Fit Distributions

September 1, 2018 | R on Thomas Roh

The ‘Fit Distributions’ shiny gadget allows easy automated diagnostics for fitting univariate distributions. It reads in numeric vectors in the global environment, and uses MLE to estimate the parameters of the selected distributions. The visual outputs are GOF statistics, density plot, pp-plot, and qq-plot. You can also adjust the number ... [Read more...]

fitur 0.6.1 Release

August 31, 2018 | R on Thomas Roh

fitur 0.6.1 shiny gadget for fitting univariate distributions has been added added test function for distfun objects diagnostic plots now have better checks for distfun objects and lists of distfun objects fitur on CRAN [Read more...]

fitur 0.6.0 Release

August 4, 2018 | R on Thomas Roh

Adding continuous distribution testing functions Kolmogorov-Smirnov, Anderson-Darling, and Cramer-Von Mises S3 methods have now been added for distfit objects Code reformatting and cleanup fitur on CRAN Continuous Distribution GOF Tests
library(fitur)
x <- rgamma(100, 1, 1)
fit <- fit_univariate(x, 'gamma')
ks_test(fit, x)
## 
##  One-sample Kolmogorov-Smirnov test
## 
## data:  x
## D = 0.082165, p-value = 0.5093
## alternative hypothesis: two-sided
ad_test(fit, x)
## 
##  Anderson-Darling test of goodness-of-fit
##  Null hypothesis: distribution 'distfun[[2]]'
## 
## data:  x
## An = 0.49058, p-value = 0.756
cvm_test(fit, x)
## 
##  Cramer-von Mises test of goodness-of-fit
##  Null hypothesis: distribution 'distfun[[2]]'
## 
## data:  x
## omega2 = 0.079325, p-value = 0.6968
[Read more...]

Speed Up Shiny Coding with Data

June 19, 2018 | R on Thomas Roh

Introduction In this excercise, I’m going to show how to automate some aspects of coding in shiny to speed up development. Traditionally, in user interface development, one has to explicitly type out each individual input argument. For small applications, this is justified and probably isn’t worth the time ... [Read more...]

Animating a Monte Carlo Simulation

May 18, 2018 | R on Thomas Roh

Introduction Oftentimes, I run into difficulty trying to explain some of the concepts of statistical sampling with audiences that either have very limited or no understanding of statistics. Given that the majority of communication of analysis has to be digested in a 1-2 hour meeting, data visualization typically is the ...
[Read more...]
1 2

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)