Related
Jul 28, 2017 How to Install OpenCV in Ubuntu 16.04 LTS for C / C. July 28, 2017 admin C, opencv 42. In this post we will see How to Install OpenCV in Ubuntu for C/C. OpenCV is an image processing library created by Intel and later supported by Willow Garage and now maintained by Itseez. OpenCV means Intel® Open Source Computer Vision Library. Feb 12, 2011 Tired of Using C compilers in Linux Ubuntu, than install Dev C/C Compiler, it makes world so easy.
Jul 28, 2017 In this post we will see How to Install OpenCV in Ubuntu for C/C OpenCV is an image processing library created by Intel and later supported by Willow Garage and now maintained by Itseez. OpenCV means Intel® Open Source Computer Vision Library.
Introduction
R is a popular open source programming language that specializes in statistical computing and graphics. It is widely used for developing statistical software and performing data analysis. R is easily extensible, and the community is known for continuously adding user-generated packages for specific areas of study, which makes it applicable to many fields.
In this tutorial, we’ll show you how to install devtools and use it to install a package directly from GitHub.
Prerequisites
To follow along, you will need R, installed on an Ubuntu 16.04 server with a minimum of 1GB of RAM and a non-root user with sudo
privileges. How to Set Up R on Ubuntu 16.04 can help you.
Step 1 — Installing System Dependencies for devtools
We’ll install devtools from the interactive shell, but before we do, we’ll need to install these system dependencies:
Once this is complete, we’re ready to proceed.
Step 2 — Installing the Devtools Package
Devtools will enable us to install and build packages directly from GitHub, BitBucket, local files, as well as to install specific versions from CRAN. To make devtools
available site-wide, we’ll enter R’s shell as root:
From within the monitor, we’ll use the install.packages()
function to install devtools
from the official Comprehensive R Archive Network (CRAN).
When prompted, we’ll select 1 for 0-Cloud, which will connect us to the Content Delivery Network (CDN) provided by RStudio, in order to get the geographically closest mirror. After making our selection, installation will begin. This may take a while. When it’s finished, near the end of the installation output, we should see:
Next, we’ll put it to the test as we fetch and build a project directly from GitHub.
Step 3 — Installing an R Package from GitHub
In this step, we’re going to install the latest development build of Shiny, a web application framework for R, directly from GitHub. We’ll do this using the install_github
function provided by devtools
. A GitHub package is defined by its author (rstudio
) and its name (shiny
) which you can find from the GitHub URL of the main project page: https://github.com/rstudio/shiny
.
Use the following command to install:
Installation has successfully completed when we see the following lines near the end and are returned to the R prompt:
We can see the specific version of Shiny we’ve installed with the following command:
In the next step, we’ll take a quick look at Shiny. We’ll need to do a couple of system-level tasks first, so we’ll exit the monitor with the following command or by using CTRL-D.:
Either of these will prompt you to save your workspace image, R’s working environment that includes user-defined objects. This isn’t necessary, so you can safely enter n
.
Since we’ll be using a web browser to look at an example of what Shiny can do, we’re going to make sure that web traffic is allowed.
Check the Firewall
Shiny is a web application framework, so in order to view its examples in a browser, we’ll need to ensure that web traffic is allowed on our firewall. The built-in web server randomly chooses a port each time it is started unless it is started with a specific value. In order to make firewall management easier, we’ll specify port 4040 when we run our example.
Let’s check the status of the firewall:
In this case, only SSH is allowed through:
You may have other rules in place or no firewall rules at all. Since only SSH traffic is permitted in this case, we’ll add port 4040 and check the status when we’re done:
With the firewall configured, we’re ready to take a look at Shiny.
Run Shiny:
We’ll connect to R, this time as a regular user:
Next, we’ll load shiny
:
Shiny includes eleven built-in examples that demonstrate how it works. We’ll load the shiny
library, then run the first example. Because we are working on a remote server, we’ll specify the host address in order to browse from our local machine. We’ll also set launch.browser
to FALSE
so it doesn’t try to launch a browser on the remote server:
Let’s visit this URL in a web browser:
We installed Shiny to illustrate using devtools
to install directly from a GitHub repository. Then we ran the example Shiny application without elevated privileges to verify that all users have access to the package.
Reinstalling the Stable Version of Shiny
For a production situation, we would install from CRAN unless we had a compelling reason to install from the repository.
Let’s take a moment to return to the stable package. First, we’ll interrupt the server with CTRL-C, then exit the R shell with CTRL-D and re-enter it as root:
Since we exited the shell, we’ll be prompted to choose a mirror, and we’ll select 1 again.
We can install the stable version with the following command, which will overwrite the installation from GitHub that we completed in the earlier step:
Dev C++ For Ubuntu 14 1
Let’s verify the change in version:
The output indicates that instead of 0.14.9000
, the version we installed from GitHub, we’re now running the stable release.
Note: We can also find out more information about a package’s version from the system command-line from its DESCRIPTION file.
Dev C For Ubuntu 14 4
Conclusion
Dev C For Ubuntu 14 2
In this tutorial, we’ve installed the latest Shiny package directly from GitHub and learned how to reinstall its stable release from CRAN. If you’re interested in learning more about Shiny itself, you might like to take a look at RStudio’s Shiny tutorial. You might also be interested in installing the open source RStudio Server, an interface to a version of R running on a remote Linux server, which brings an IDE to a server-based deployment.