Introduction to the Tidyverse

Bhuwanesh Nainwal
Updated on 17-Jan-2023 15:38:22

744 Views

The R package collection known as tidyverse was created with the goal of collaborating and handling data effectively. The Tidyverse package is open-source and constantly improved by the data science community. A data scientist must have a fundamental understanding of every package included under the tidyverse umbrella. All eight packages—purr, ggplot2, dplyr, tidyr, stringr, tibble, readr, and forcats —will be covered in depth. Tidyverse Packages Tidyverse groups several packages in R. It consists of the following packages − Package Name Usage purrr Used for function programming ggplot2 Used for creating graphics dplyr ... Read More

Working with Dates and Times in R with lubridate

Bhuwanesh Nainwal
Updated on 17-Jan-2023 15:26:28

878 Views

The dates and times appear simple and easy at first impression as we deal with them in our day-to-day life. But a lot of complexity involves when we work with dates and times objects in R. This article focuses on working with dates and times using the lubridate package in R. You can install this package locally by using the following command in the CRAN’s terminal − install.packages("lubridate") Types of data/time objects in R There are three types of data/time objects and are listed below − Date () object − Prints the date. Time () object − Prints ... Read More

Parallel Programming in R

Bhuwanesh Nainwal
Updated on 17-Jan-2023 15:20:04

5K+ Views

Parallel programming is a software development practice that involves dividing a computation or task into smaller parts that can be executed concurrently or in parallel. Parallel programming can help improve the performance and efficiency of your R code by utilizing multiple processors or cores in a computer or cluster. The main concept of parallel programming is, if one operation can be performed in S seconds using a single processor, then it should be able to get executed in S / N seconds when N processors are involved. Need for Parallel Programming in R Most of the time the code in ... Read More

Manipulate Time Series Data in R with xts and zoo

Bhuwanesh Nainwal
Updated on 17-Jan-2023 15:15:11

1K+ Views

The xts and zoo are two R packages that provide tools and functions for manipulating time series data. Both packages offer functions for reading, writing, and manipulating time series data stored in various formats, such as CSV, Excel, and other data sources. We shall start by introducing xts and zoo classes, basic manipulations, merging and modifying time series, and by the end, we will be discussing applying and aggregating by time. XTS and Zoo class Syntax In R, xts extends the zoo class. An xts object is similar to a matrix of observations that are indexed by a time object. ... Read More

Joining Data in R with Data Table

Bhuwanesh Nainwal
Updated on 17-Jan-2023 15:06:04

2K+ Views

In this article, we will discuss joining data in R using data.table package. By the term “joining data” we mean to say that performing different types of joins operations like INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, AND FULL OUTER JOIN between two or more tables. The main purpose of doing join operations between tables is to access data from multiple tables on the basis of some attribute (or column) condition. R provides us data.table package with the help of which we can handle tabular data (having rows and columns) very efficiently. This package was launched as an alternative ... Read More

Defensive R Programming

Bhuwanesh Nainwal
Updated on 17-Jan-2023 14:54:01

472 Views

Defensive programming is a software development practice that involves designing and implementing code in a way that anticipates and prevents errors and vulnerabilities. In R programming, defensive programming involves using techniques and strategies to ensure that your R code is robust, reliable, and secure. By the word “Defensive” in defensive programming, most of you might be confused about whether it means writing such a code that doesn’t fail at all. But the actual definition of “Defensive programming” is writing such a code that fails properly. By “failing properly”, we mean − If the code fails, then it should be ... Read More

Data Manipulation in R with Data Table

Bhuwanesh Nainwal
Updated on 17-Jan-2023 14:17:38

2K+ Views

Data manipulation is a crucial step in the data analysis process, as it allows us to prepare and organize our data in a way that is suitable for the specific analysis or visualization. There are many different tools and techniques for data manipulation, depending on the type and structure of the data, as well as the specific goals of the manipulation. The data.table package is an R package that provides an enhanced version of the data.frame class in R. It’s syntax and features make it easier and faster to manipulate and work with large datasets. The date.table is one ... Read More

Golang Program to Search an Element in the Slice

Akhil Sharma
Updated on 17-Jan-2023 13:08:47

4K+ Views

In this tutorial, we will grasp how to search an element in slice using different set of examples. A slice is a sequence of elements just like an array. An array is a fixed sequence of elements whereas slice is a dynamic array which means its value is not fixed and can be changed. Slices are more efficient and faster than arrays moreover they are passed by reference instead by value. Syntax func append(slice, element_1, element_2…, element_N) []T The append function is used to add values to an array slice. It takes number of arguments. The first argument ... Read More

Remove All Elements from an Array in Golang

Akhil Sharma
Updated on 17-Jan-2023 12:35:42

6K+ Views

In this tutorial, we will execute the program of removing all the elements of array using different set of examples. An array is a well-defined collection of elements stored at contiguous memory locations. The output is printed in the screen using fmt.Println() function. Let’s see few examples to get a clear understanding of this concept. Syntax func append(slice, element_1, element_2…, element_N) []T The append function is used to add values to an array slice. It takes number of arguments. The first argument is the array to which we wish to add the values followed by the values to ... Read More

Get First and Last Element from a Slice in Golang

Akhil Sharma
Updated on 17-Jan-2023 12:32:32

2K+ Views

In this tutorial, we will discuss how to obtain the first and last element from a slice. A slice is a dynamic-sequence that stores elements of a similar type. It is similar to array but it can be resized whereas an array is of fixed range. Let’s understand the concept using some examples. Method 1: Using integer values In this method, we will use integer values to get the first and last element from a slice. The output will be printed on the screen using fmt.Println() function. Let’s go through the example to understand how it can be done. Algorithm ... Read More

Advertisements