# Category: Introduction to R Programming

# What is Data Acquisition step in Data Analytics process step

## Data Acquisition step in Data Analytics process step

#### Data Acquisition step is used to collect data from various sources for analysis to answer the question raised in Business Definition Step.

#### Data Acquisition step involves

- File Handling
- Web Scraping
- SQL Data

#### Some examples of Data Acquisition steps are :

- Twitter, Facebook, LinkedIn, and other social media and information sites provide streaming APIs.
- Server logs can be extracted from enterprise system servers to analyze and optimize application performance.

# What are different processes involved in Data Analytics ?

## Data Analytics consists of below processes

###
- Business Problem
- Data Acquistion
- Data Wrangling
- Explanatory Data Analysis
- Data exploration
- Conclusion or Prediction
- Communication

# tapply() function in R

tapply()

Apply a function to each cell of a ragged array, that is to each (non-empty) group of values given by a unique combination of the levels of certain factors.

##### Usage

`tapply(X, INDEX, FUN = NULL, …, default = NA, simplify = TRUE)`

# R function: which.max

R function: which.max

`which.max`

returns the *position* of the element with the maximal value in a vector.

# Summary function in R

### Summary function in R

summary() is a generic function used to produce result summaries of the results of various model fitting functions

### Example

summary(school)

summary(as.factor(school$age))

# names() function in R

### names() function in R

names() function is used to give name to vector members.

### Syntax

names(vector_variable) = c(“names”)

### Example

names(employee role) = c(“EmpNo”,”EmpRole”)

# Modulo Operator in R ( %% operator )

### Modulo Operator in R ( %% operator )

The modulo returns the remainder of the division of the number to the left by the number on the right

### Example :

5%%3

### Result :

2

# List in R

## List in R

### List is data structure in R with elements which can be of different types.

### 1. Creating List – with different types elements

**diffTypeList <- list(1, “Introduction to R”, TRUE)**

### 2. You can access single element double square brackets`[[]]`

**Example :****print(diffTypeList[[1]]) // Output [1] 1**

### 3. You can modify by accessing element using double square brackets`[[]]`

**Example:****diffTypeList[[1]] <- 100**

# Vector in R

### Vector is a data structure in R which is of fixed type and fixed length.

It contains elements of the same type at each index. The data types can be

###
- Logical

- Integer

- Numeric

- Character

- Complex

### Vectors of different types

realNumericVector <- c(1, 2, 3, 4) # numeric

decimalNumericVector <- c(0.1, 0.2, 0.3, 0.4) # numeric

logiacalVector <- c(TRUE, FALSE) # logical

characterVector <- c(“a”, “b”, “c”) # character

integerVector <- 1:9 # integer

myComplexVector <- c(1+1i, 2+2i) # complex