Monday, May 28, 2018

The filter() method returns the elements of the array that satisfies the function that is passed into the method. If the function returns true the element is added to the filtered array, else it is ignored.

Let's say we only want to buy oil when the prices drops below $72, so we will only return an array element where the prices below $72

Monday, May 21, 2018

The map() method is similar forEach() method which means that it performs a function, however it returns a new array with the returned values. In this example we are going to perform the $1 discount of the oil prices using the map() method instead of the forEach() the difference here is that the map() method returns a new array instead of the original array, but the result will be the same.

Monday, May 14, 2018

The forEach() method loops through an array, and performs a function on each element of the array. The forEach() method can take three arguments, the first argument is a current value that you want to perform an action on. The second argument acts as the "this" value within the scope of the function. The third argument is the array itself. Most of the time only the first argument is passed. The code below passes in only one argument which is an anonymous function being performed on each element of the array using the forEach() method to calculate the oil prices in the last five days and prints it out in the console.

Thursday, May 10, 2018

Now that we R installed in Visual Studio let's install some of the more useful packages that we will use in our R development. Packages provides you with the tools to perform tasks, functionalities and datasets for the those features.

To install R devtools package do the following:

In your R project, type the following command into the R Interactive window install.packages("devtools")

Monday, May 7, 2018

The JavaScript array splice() method allows you to delete and insert array elements in one method
Before we get to the examples let's see how we would use the splice() method on an array first.

The splice method takes 1....n method parameters. The first parameter specify the position of the array that will be deleted. The second parameter specify the number of elements to be deleted after the first element's index position, or splice out. Any subsequent parameters will be the elements that will be added to the array. If there's only one parameter then all the elements before the first parameter's position will be deleted

Wednesday, May 2, 2018

In this post we are going to go over the steps to install R Tools For Visual Studio 2017. RStudio has a development environment that is bare bones for the free version. Visual Studio 2017 offers a more robust development environment if you download the R Tools feature.