If we have a data set that contains missing values at alternate places for each column then we might want to combine the columns by excluding those missing values, this will reduce the data set and the analysis is likely to become easier.For this purpose, we can use na.exclude function along with apply function as shown in the below given examples.Example 1Following snippet creates a sample data frame −x1
Data Warehousing is a technique that is mainly used to collect and manage data from various sources to give the business a meaningful business insight. A data warehouse is specifically designed to support management decisions.In simple terms, a data warehouse defines a database that is maintained independently from an organization’s operational databases. Data warehouse systems enable the integration of multiple application systems. They provide data processing by offering a solid platform of consolidated, historical information for analysis.Data warehouses generalize and centralize data in multidimensional space. The construction of data warehouses contains data cleaning, data integration, and data transformation and can ... Read More
To create a colored box for base R plot, we can use box function with col argument where we can pass the color other than black because black is the default color.We first need to create the plot using plot function and then box function will be used as shown in the below given example.ExampleTo create a colored box for base R plot, use the following code −plot(1:5) box(lwd=5, col="blue")OutputIf you execute the above given code, it generates the following output −To create a colored box for base R plot, use the following code −plot(1:5) box(lwd=10, col="red")OutputIf you execute the ... Read More
Data integration is the procedure of merging data from several disparate sources. While performing data integration, it must work on data redundancy, inconsistency, duplicity, etc. In data mining, data integration is a record preprocessing method that includes merging data from a couple of the heterogeneous data sources into coherent data to retain and provide a unified perspective of the data.Data integration is especially important in the healthcare industry. Integrated data from several patient records and clinics assist clinicians in identifying medical disorders and diseases by integrating information from several systems into a single perspective of beneficial information from which useful ... Read More
If we know the total number of rows we want in our matrix and the number of columns then we can use matrix function to create a matrix by filling the data with predefined values. These values must be equal to the multiplication of number of rows and columns.Check out the below given examples to understand how it works.Example 1Following snippet creates a matrix in R by filling the data with predefined values in loop −n=20 k=2 data=rpois(n*k, 5) M1=matrix(data, nrow=n, ncol=k) M1If you execute the above given snippet, it generates the following output − [, 1] [, 2] ... Read More
The autocorrelation plot or ACF plot is a display of serial correlation in data that changes over time. The ACF plot can be easily created by using acf function.For example, if we have a vector called V then we can create its autocorrelation plot by using the command given below −acf(V)Check out the below examples to understand how it can be done.Example 1To create ACF plot in R, use the code given below −x
If we have a matrix that contains character columns and we want to convert a single column to numeric then we first need to convert the matrix into a data frame using as.data.frame function after that as.numeric function can be used to change the particular column to numeric type as shown in the below examples.Example 1Following snippet creates a matrix −M1
To find the average of a particular column in R data frame, we can take the help of delta ($) operator.For example, if we have a data frame called df that contains a column x then we can find the average of column x by using the command given below −mean(df$x)Example 1Following snippet creates a sample data frame −x1
To find the mean of all matrices stored in an R list, we can use sapply function along with mean function. For example, if we have a list called LIST that contains some matrices then the mean of each matrix can be found by using the command given below −sapply(LIST,mean)Check out the below given example to understand how it works.ExampleFollowing snippet creates a list of matrices −M1
To update single value in an R data frame, we can use row and column indices with single square brackets.For example, if we have a data frame called df that contains two columns and ten rows and if we want to change the fifth value in second column to 10 then we can use the command given below −df[5,2]
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP