This is the third part of the series. This article is about how you can import data into R. Importing data into R is simple. Example of Importing data are provided below:
1. Importing CSV in R:
R can read .CSV (Comma separated files). The best way to read .csv file is as follows:
# Read CSV into R
Data <- read.csv(file=”D:/m/1.csv”, header=TRUE, sep=”,”)
Here header=TRUE specifies that this data includes a header row and sep=”,” specifies that the data is separated by commas.
2. Importing Excel File
One of the best ways to read an Excel file is to export it to comma delimited file. You can use the xlsx package to access Excel files. The first row should contain column names.
# If First row contains variable names then
Data <- read.xlsx(“D:/m/1.xlsx”,1)
# Read in the worksheet named mydata
Data <- read.xlsx(“D:/m/1.xlsx”, SheetName=”mydata”)
3. Importing txt File into R
# Reading .txt File as dataframe
Data <- read.delim(“D:/m/1.txt”, sept=”\t”, header=TRUE)
This is part Second of the R series. In the first part, we have discussed Introduction to R Programming and how to install R. In this part, we will discuss some of the basic commands that you required to initiate R.
Basic Syntax in R
1. Basic Command
2. Installing Packages
Let us start with some basic syntax of R. You can either use R Studio or R console to do the task. Here is initial line of code about how to remove all object stored in R:
Remove all objects stored-
Set Current Working Directory-
If you want to read files from a specific location you need to set working directory in R. The following example shows how to set the working directory in R to the folder”Set” within the folder “Data” on the D drive.
Current working Directory-
Packages are collections of well-defined functions and data in some required format. We can install packages according to our need. For package installation, we need an internet connection and we need to write this code:
Here I have written one package name for your reference install.packages(“dmm”)
We have to install package only once and then we need to include its library. To include a library: library(package_name)
In this article, we have discussed the how to set the directory to proceed our work and how to install package.
Now, give it a try and we will discuss how to import different type of files in R in next article. If you have any doubt feel free to comment.
At present time in this world, social media is playing a crucial role and has become as essential as food for each and every person. Anyone can be social by access to social media platform through Facebook, Instagram, and Twitter. In these, Facebook is most popular platform to connect to individuals but to connect this platform , via Android, window and ios mobile, is the obstacle and none less than a headache but now you don’t need to worry about this through this post this problem of you will be solved and you will be accessible to social platform from that gadget with which you want-
Let’s know how to download Facebook app step-by-step
(A) FOR ANDROID
Step 1- First you have to find the play store icon in your mobile which picture icon is given below that is ticked with red mark –
Step 2- Click on that icon which is showing you above. as soon as you will click on it you will reach in google play store –
In this step you can face a problem related to google account.
It will show you are tow option –
How to tackle from these problems
It is very easy, if you ever made google account in “gmail” then you would be gmail id then need to click on “Existing” option and if you didn’t make account in “gmail” before this then need to click on the second option which one is “New” even as you will click on it you will reach that is showing below –
From here just you have to follow some steps and you will be login in “Play Store”.
3. After reaching in play store type the “Facebook” where the red mark is ticked below –
As you will type there a list of keywords will be open just click there where “facebook” word is written and you will reach
4. Click on install button. Facebook will start to download in your mobile.
(B) FOR WINDOWS
1. To download facebook in window mobile primarily you have find “store” option in mobile –
2. As you click on it you will come on this slide –
Type “Facebook” where yellow mark is ticked –
3. After it this slide which is shown below will be open click on “Free” button.
Note- If after clicking on “Free” button this ask for credentials then you just need to do that what we discussed above in second step of( A).
(3) FOR iOS
1. First you have to find the App store icon in your mobile which picture icon is given below that is ticked with yellow mark –
2. As you click on it you will come on this page –
Type “Facebook” where mark is ticked –
3. After it this slide which is shown below will be open click on “download” button.
Note- If after clicking on “download” button this ask for credentials then you just need to do that what we discussed above in second step of(A).
R is an open source scripting language for predictive analytics, statistical analysis, graphical representation, and reporting. R language was created first in 1993 by Robert Gentleman and Ross Ihaka at the University Of Auckland, New Zealand as an implementation of the S programming language. R Language is commonly used for statistical computing where there is a heavy data roles such as data mining and statistics, etc. It is a GNU project, which is similar to the S language and environment, which was developed at Bell Laboratories.
R Programming language includes vector, scalars, matrices, list and data frames. It also includes genetic functions that support linear modeling, non-linear modeling, classification, clustering and more. It is remained popular in academic due to its robust features. It is freely available under GNU General Public License and runs on UNIX platforms and other systems including Linux, Windows, and macOS.
Features of R Programming:
• R provides a large and integrated collection of tools for data analysis.
• R is an interpreting language, can be rather slow, but can be integrated with other high efficient languages such as C, C++ etc.
• R is an effective language that includes conditions, loops, user-defined recursive functions.
Local Environment Setup
If you want to set up your environment for R, then you can follow the given steps given below:
You can download the Windows installer version of R from R-3.4.3 for Windows (32/ 64 bit) (https://cran.r-project.org/bin/windows/base/).
After downloading, you can just double click and run the installer accepting the default settings. After the installation, click on the R icon on a screen to do Programming.
Why should you learn R programming Language?
While R can seem overly complex at the start, for data enthusiastic who is looking for a programming language while R can be worth for your consideration. R has a fantastic mechanism for creating the data structure. If you are doing data analysis, you should to be able to put your data into a natural form. You don’t need to warp your data into a particular structure. Graphics should be central to data analysis. We don’t intuitively grasp numbers like we do pictures. It is easy to make graphs for exploring data. Real data has missing values. R has many functions that control, how missing values are to be handled.
Some employees in Facebook use R language to analyze user behavior, while more than 500 Google Employees are using R to make its advertising more effective. One of the biggest benefit to open source software is that upgrades are much more regular. According to 2014 survey, R is one of the most powerful and popular programming language used by data scientist.
Hopefully, this helps you to get an idea of Why R programming is vital for doing data analysis.
Sales analytics is used to identify, model, analyze and predict trends of sales which helps to determine the success of sales drive on the basis of the previous result and to forecast the sales. Data may be taken from various sources such as transactions, surveys and then analyzed. For better result relevant data is mined in order to make relationships and to forecast future sales based on the previous sales data that will be useful for the organization.
Organizations which want to forecast the sales have dedicated data mining experts or data analyst who finds the hidden relationship and trends which can be further used to provide a more accurate result for forecasting. So that the organizations have enough information to act on and discover new information.
An example of Sales Analytics: Google analytics and Web analytics are designed to track consumer activity on the web. Through this data get collected regarding a website that all visitor visited, this can be either in log files or it may be a cookie and then this information is analyzed to determine whether in which page visitor visited and if it is E-Commerce website whether he has purchased that product or not. In Social Network, it is analyzed in order to find out the most visited visitor and help to determine whether a social campaign which was created is fruitful or not.
Customer analytics is the process of identifying the customer’s insight, which is necessary for the organizations to deliver offers that are anticipated and relevant, based on their interaction through various channels. It is the behavior based marketing approach, which focuses on customer retention. Customer Analytics is about unlocking the hidden value of your data and turns your data into something that you can use to drive your business further, faster and smarter.
Customer Analytics guides you to examine captures consumer behavioral data, and give you a richer, deeper understanding of your end-user data that help to segment the market. Customer Analytics give you the information that makes you stay ahead of your audience’s consideration and purchasing behavior to ensure you always deliver the right need, at the right time and in the right way. The result obtained from the data can be used for forecasting. Data mining techniques are used with Customer analytics. The online analytical tool gives the online capability to analyze the data. The data obtained from this tool can provide best results for the organization to find ways to increase their sales.
Importance of Customer Analytics:
1. To know customer’s buying behavior i.e. how the customer will behave when interacting with your Organization. This helps you to forecast further for organization growth.
2. To know customer’s buying preferences. So that you will be more successful at delivering relevant offers that attract them.
The goal of customer analytics is to make the perfect view of the customer for the group to work and make decisions about how to identify high-value customers, acquire and retain them.