Tag Archives: rlang
Learn R – How to Fix Read.Table Command Reading Lesser Rows
This article represents the problem statement related with read.table reading fewer or incorrect or lesser number of lines or rows when reading a text file having multiple columns, and the solution to the same. This is going to be a shorter blog. But since it solved a problem on which I spent some time, I chose to write about the same. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Problem Statement: Reading Fewer Lines with read.table Command I have been learning the naive bayes classification. I downloaded this SMS collection data. I went ahead and tried to load …
Data Science – Data Cleaning R Commands for Text Classification Problems
This article represents concepts and related R command set used to clean the text in order to make it ready for text classification. The R command set belongs to tm package. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Lets load a set of messages along with appropriate classification using following command. messages <- read.table( file.choose(), sep=”\t”, stringsAsFactors=FALSE) The messages data frame could have two features, such as type and text where each piece of text is associated with an appropriate type. Once done, lets go ahead and create a Corpus object out of all the message text. …
Learn R – How to Add New Column to Data Frame
This article represents concepts and code samples on how to add new columns to a data frame using R programming language. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Lets create a student data frame. Following is the code: # Create non-empty data frame with column names # Assign names to x x <- c( “Calvin”, “Chris”, “Raj”) # Assign names to y y <- c( 10, 25, 19) # Create a non-empty data frame with column names # Assign x to “First Name” as column name # Assign y to “Age” as column name student <- data.frame( …
Data Science – How to Scale or Normalize Numeric Data using R
This article represents concepts around the need to normalize or scale the numeric data and code samples in R programming language which could be used to normalize or scale the data. Please feel free to comment/suggest if I missed mentioning one or more important points. Also, sorry for the typos. Following are the two different ways which could be used to normalize the data, and thus, described later in this article: Why Normalize or Scale the data? Min-Max Normalization Z-Score Standardization Why Normalize or Scale the data? There can be instances found in data frame where values for one feature could range between 1-100 and values for other feature could …
Learn R – How to Append Rows to Data Frame
This article represents concepts and code samples on how to append rows to a data frame when working with R programming language. Please feel free to comment/suggest if I missed mentioning one or more important points. Also, sorry for the typos. Following are the key points described later in this article: How to append one or more rows to an empty data frame How to append one or more rows to non-empty data frame For illustration purpose, we shall use a student data frame having following information: How to Append one or more rows to an Empty Data Frame Following code represents how to create an empty data frame and …
Learn R – Hello World with R – Code Example
This article represents some of the basic concepts required to be understood to write Hello world using R programming language and, execute the same. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Basic Concepts to Write Hello World Function in R Hello World – Code Example Basic Concepts to Write Hello World Function in R Following are some key points to pay attention at, while working Hello World example: R code is written as a set of one or more functions. In R, one could assign a function …
I found it very helpful. However the differences are not too understandable for me