Publications by Duong Tran

Reading Raw Data

05.12.2020

The first task before any data analysis can begin is of course importing the data into the software application that you are using. And this often means reading the data from a comma-separated values (CSV) file. This tutorial gives a brief introduction on how R imports a CSV file. There is more than one package that can do this, but here we shall...

2351 sym R (1920 sym/11 pcs)

Mixing SAS and R Plots

26.04.2021

Introduction Multiple plots on a graph is often desired; in lattice, panel or sometime as inset layouts. SAS and R, both have functionalities for these display, but have you ever thought of combining SAS and R plots? Not by cut and paste but programmatically. This is absolutely possible and I shall go over such a technique with some examples in t...

2340 sym R (1516 sym/1 pcs) 3 img

A SAS RTF Parser Macro with the Aid of an R Package

18.04.2021

Introduction Extracting data from a Rich Text Format (RTF) table is a common need. For example, in clinical trial reporting, this desire of extracting RTF tables and converts them into SAS datasets are mainly for two reasons. One, to validate tables and listings (TLs) programmatically; secondly, to compare different versions of (TLs). There are p...

3060 sym R (3414 sym/4 pcs) 2 img

flextable

05.06.2021

Introduction flextable is a fantastic package for tabulating static tables. The outputs can be saved as (html, docx, ptx, png) formats and its grammar is similar to that of ggplot2, where each additional aspect to a table is build-up of statements separate by the pipe symbol “%>%”. The API is very well designed with rich functionalities. You ...

3755 sym R (2292 sym/3 pcs) 4 img

Data Formats Converter

31.07.2021

Introduction This Shiny application allows data in SAS (including xpt file), SPSS and STATA formats to be loaded and export to csv, xls or json formats. Conclusion The haven package can reads various data formats. Once in a data frame we can re-write it to csv, xls and json formats etc. ...

300 sym 1 img

Word Cloud Generator

03.07.2021

Introduction There are many Word Cloud Generators online and some are free. R also has the wordcloud package and you can use this with Shiny to build your own Word Cloud Generator. This post shows such a simple Shiny application with some generated word-cloud samples. Shiny API Input Data tidyverse_packages.csv ====================== word, co...

427 sym R (661 sym/5 pcs) 4 img

A Novel Approach to Patient Profiling

16.01.2022

Preface This is a poster I presented at the PSI-EFSPI 2008 conference. The method is simple yet in my opinion beautiful. I have subsequently seen a couple of examples of the same principle. Essentially we just tag a unique marker at a location of a text file (i.e. HTML, RTF etc.) and replace the marker with value on post-processing. Here I am us...

661 sym 3 img

Generate Mathematical Expressions in SVG

09.01.2022

...

8 sym 3 img

Consort Diagram

06.11.2021

Consort Diagram This is a Consort Diagram done with SAS SGPLOT. You will see this in a Clinical trial report, representing the overview flow of patients through the stages of the trial. The PolygonPlot function makes it simpler to do this diagram. Other functions you will need are, SeriesPlot and TextPlot. Working out the co-ordinates is probably...

649 sym 1 img

2D Attractors

23.10.2021

Shiny Application Last week my post was on the Lorenz attractor. This time it is the Hopalong. Unlike the Lorenz this is a 2D points attractor where you plot many (it could be up 10 millions) tiny points rather than the paths of consecutive points. Again these were plotted with ggplot2 (geom_point). You can google to find many more examples and s...

487 sym 11 img