Site icon R-bloggers

Online resources for teaching

[This article was first published on R on Coding Club UC3M, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

In this session I will try to show some utilities present in the web. One of them will help us to execute R code from the web, using an online compiler, without installing any kind of software in our computers. The other one, it can help us to solve optimization problems by a graphics way. We can draw the restrictions, the feasible region, and others elements that we can need to solve the problems. Finally, I will show other helpful options for teaching.

R (online)

Introduction

Why do we need to use online software?

When we try to teach in a computers room, we often have different problems such as:

In the last case there is even an additional problem, the enormous number of versions available.

A solution

In order to solve this problem, I think that it is a good idea to use online software. Why? Because, all the people can access the same version of the code, with the same version of the programs, and in the case of R, with the same version of the packages.

Options

What options are on the web?

Basically, there are three options:

In most cases, compilers will have the basic packages loaded, but, even so, the versions might be different.

Executing the following instruction:

installed.packages(.Library)

We will be shown the packages that are installed in the online Servers.

An online terminal

In this case the R version is 3.4.1 (2017-06-30)

Example of an online terminal (https://www.tutorialspoint.com/unix_terminal_online.php)

An online compiler on your own website

Another option would be to add, on your own web page, an HTML box with a code that allows you to embed an R compiler. To run the code, just write it inside the mentioned box and, when executed, the result will be shown on our web page.

In this case, you only need to write this code in a html box.

<iframe width='100%' height='100%' src='https://rdrr.io/snippets/embed/' frameborder='0'></iframe>

Example of an embedded compiler in your own web (https://sites.google.com/site/estadisticaaplicadaaeducacion2/r)

If we ask in R for the version, it shows:

               _
platform       x86_64-pc-linux-gnu
arch           x86_64
os             linux-gnu
system         x86_64, linux-gnu
status
major          3
minor          4.1
year           2017
month          06
day            30
svn rev        72865
language       R
version.string R version 3.4.1 (2017-06-30)
nickname       Single Candle

An online compiler for scripts

Using this option we can access a web page with an online compiler and write the commands that will be executed on the server. The results (text and graphics) will be displayed on the same web.

For this case the following 3 options are presented, they are not all that exist, but it is a good sample of online R compilers:

Rextester

Example of the application at https://rextester.com/l/r_online_compiler

Jdoodle

Example of the application at https://www.jdoodle.com/execute-r-online

Tutorialspoint

Example of the application at https://www.tutorialspoint.com/execute_r_online.php

Examples

  1. Distribution of the sample mean. http://www.r-fiddle.org/#/fiddle?id=JjNDLEk3&version=6
  2. Dice (See how the probability converges to 16). https://rextester.com/GFO27631
  3. Coins (See how the probability converges to 12). https://rextester.com/PMXS69220
  4. Definition of a Chi-square distribution. If $X_i->N(0,1)$, and $Y=\sum{X_i^2}$, then $Y$ follows Chi-square distribution. http://www.r-fiddle.org/#/fiddle?id=x2IrLlmq&version=1
  5. Definition of a t-Student distribution. If $X_i -> N(0,1)$, and $Y=\sum{X_i^2}$, then $T=\frac{X_i}{\sqrt{\frac{Y}{n}}}$ follows a t-Student distribution. http://www.r-fiddle.org/#/fiddle?id=ph6cnsbI&version=1
  6. Help for tasks. https://rextester.com/OYWAF88158

GeoGebra (online)

Probability distributions

You can use GeoGebra in order to consult values and probabilities from distributions.

Probability distributions (https://www.geogebra.org/classic#probability)

Apps

GeoGebra allows you to create apps without signing up.

Geogebra online (https://www.geogebra.org/)

Nevertheless, you can obtain all the best if you log in. In that case you can save the apps in the server (online), and share them with your students.

In the image below it is shown the different forms of signing in for GeoGebra.

Examples

As mentioned before, you can create a group to exchange apps with your students, for example this: GeoGebra Group -> OySelE (QY7KT)

Example of GeoGebra Group (https://www.geogebra.org/group/landingpage/id/QY7KT)

As an example, Problem 3.1

https://www.geogebra.org/m/qvKCCPMX/pe/166447


PSPP (online)

GNU PSPP is a program for statistical analysis of sampled data. It is free as in freedom replacement for the proprietary program SPSS, and it looks very similar to it within a few exceptions. To use it, you must need to log in first.

PSPP on rollApp (https://www.rollapp.com/app/pspp)


RawGraphs

What is RAWGraphs? In its own site says: RAW Graphs is an open source data visualization framework built with the goal of making the visual representation of complex data easy for everyone.

RawGraphs (https://rawgraphs.io)

In the next picture you can see some examples of graphics that you can make with Raw. When you select one, a short description will apppear on the left side panel.

# Data for an example in Raw.
# copy and paste in Raw.

Exam1, Exam2, Exam3
A, A, A
A, NA, NA
A, A, NA
A, NA, A
NA, A, A
NA, NA, A
NA, NA, NA

If we choose an alluvial diagram, this is the result.

To leave a comment for the author, please follow the link and comment on their blog: R on Coding Club UC3M.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.