Time

Interactive dots via an R Shiny app using the visNetwork package

The following R Shiny app is interactive. Try moving the dots around. This is accomplished using the visNetwork package.

visNetwork is an R package for visualization of networks.

Engineering animation: Engineering Animation, Inc. was based in Ames, Iowa in the United States. It was acquired by Unigraphics Solutions, Inc., a subsidiary of the German technology multinational, in 2000. A number of multimedia medical and computer game titles were developed by the company. There is a spin-off company called Demonstratives that is part of the business of theEAI.

An R Shiny app showing diffusion of a particle in 2D (gganimate) and 3D (RGL widget)

Below is an R Shiny app which demonstrates diffusion in both 2D and 3D. The 2D aspect is animated via gganimate and the 3D plot is interactive (zoom in and out and rotates) via an RGL widget.

The net movement of atoms, ion, molecule, and energy from a region of higher concentration to a region of lower concentration is known as Diffusion. A gradient in free energy or chemical potential is what drives Diffusion. In spinodal decomposition, it’s possible to diffuse “uphill” from a region of lower concentration to a region of higher concentration. The inherent randomness of the diffuse entity can be used to model many real-life scenarios. Statistics, probability theory, information theory, neural networks, finance, and marketing are some of the fields where the corresponding mathematical models are used.

Many fields, including physics, chemistry, biology, sociology, economics, statistics, data science, and finance, use the concept of diffusion. The idea of spreading out a substance or collection is common to all of these. The change in the value of a quantity is known as a gradient. A change in concentration over a distance is called a concentration gradient, a change in pressure over a distance is called a pressure gradient, and a change in temperature over a distance is called a temperature gradient.

The Latin word diffundere means “to spread out”.

An R Shiny app example using deSolve and gganimate – A bouncing ball

Below is an R Shiny app which utilizes the deSolve and gganimate packages for a fun bouncing ball effect.

The physical behavior of bouncing balls, particularly its motion before, during, and after impact against the surface of another body is the subject of the physics of a bouncing ball. The bouncing ball’s behavior is an introduction to mechanics in high school or undergraduate physics courses. Modelling the behavior is complex and of interest to sports engineers. The motion of a ball can be described by projectile motion, which can be affected by gravity, drag, and the Magnus effect, while the impact can be described by the coefficient of restitution. To ensure fair play, sports governing bodies set limits on the ball’s aerodynamic properties and forbid tampering. The Bounciness of balls has been a feature of sports for a very long time.

An app to solve differential equations online via R Shiny (deSolve Package)

This is an app to solve differential equations online. The app is made via R Shiny (deSolve package).

A differential equation is an equation that relates unknown functions and their derivatives. The functions, derivatives and differential equation are used in applications to represent physical quantities. differential equations play a prominent role in engineering, physics, economics, and biology due to their common relations. The study of differential equations consists of the study of their solutions and the properties of their solutions. Many properties of solutions of a given differential equation can be determined without computing them.

When a closed-form expression is not available, solutions may be approximated numerically using computers. Many numerical methods have been developed to determine solutions with a given degree of accuracy, while the theory of dynamical systems focuses on qualitative analysis of systems described by differential equations.

Power Analysis App via R Shiny – Estimate sample size based on power cut off and error

A hypothesis can be tested. Any claim that can be tested will have a hypothesis about the outcome. A dog owner said his dog paid more attention to the morning paper if there was a cat in it. The owner wants to see if dogs will read the newspaper more often if there is a cat above the fold line. A null hypothesis is a statistical hypothesis test that assumes a certain outcome. The hypothesis is that the presence of a cat on the newspaper will not increase the likelihood of a dog reading it. An alternative hypothesis is the opposite of a null hypothesis and covers any effects the cat may have on the dog.

The idea of a null hypothesis is that an experiment is conducted to try to disprove it. To fully support a hypothesis, there needs to be a p-value that shows the likelihood that the result was due to the variables and not to chance. The p-value is called statistical significance. The p-value is the statistical power of a hypothesis test. The higher the statistical power, the less likely the error is. When the null hypothesis is true, a higher power shows the probability of accepting the alternative hypothesis. The problem arises when an experiment is conducted with low statistical power because a conclusion could be false.

In order for the result to be accepted, statistical power of 80 percent or more is needed. There is only a 20 percent probability of an error with an 80 percent power.

Interactive 3D RGL widget Shiny app

Here is an interactive plot. You can zoom in and out and spin it around. It is made using an RGL widget and 3dscatterplot. It is an R Shiny app.

HTML widgets work just like R plots. The only difference is that the interactive web visualization is produced by R plots. A line or two of R code is all it takes to produce a map. The R console can be used as well as R Markdown reports and Shiny web applications. You may also want to check out the gallery for the other widgets.

gganimate R Shiny app

This is an app that is using gganimate within an R Shiny app

ggplot2 implemented the description of animation into the graphics via gganimate. It can be done by providing a range of new classes that can be added to the plot object in order to change with time.

The boxplot of fuel consumption (https://gganimate.com/) is a function of cylinders and can be used to transition between the number of gears in the car. We use transition_states and provide a relative length to use for transition and state view, as this is a discrete split. There are states missing a box because not all combinations of data is present. When a box appears, it should fade into view while at should shrink away. We decided to use a sinusoidal easing for our aesthetic needs.

The way ggplot2 renders its output is similar to gganimate’s way of doing it. The frame is rendered by the function which passes it to a renderer function which combines them to the final animation. A simple wrapper around a path to a Gif file is what the default renderer returns. The last_animation function is available if the animation has been called as part of the print. In order to save the animation to a specific location, you can use the anim_save function which, like ggplot2,:ggsave, defaults to taking the last rendered animation and writing it to a file.