r on jDataLab
https://www.jdatalab.com/tags/r/
Recent content in r on jDataLabHugo -- gohugo.ioen-usSun, 02 Feb 2020 01:45:03 -0600Transform Categorical Data to Binary Matrix in R
https://www.jdatalab.com/data_science_and_data_mining/2020/02/02/factor-binary-matrix.html
Sun, 02 Feb 2020 01:45:03 -0600https://www.jdatalab.com/data_science_and_data_mining/2020/02/02/factor-binary-matrix.htmlSometimes a categorical variable, or a factor has to be transformed to a binary matrix in order to run certain modeling or computational algorithms. In R, model.mtrix creates, from a factor, a set of indicator variables. Each level of the factor, or each category, becomes one column in the resulting matrix. If a row contains the level, the corresponding value of the column is 1 or 0 otherwise.
One factor eyJsYW5ndWFnZSI6InIiLCJzYW1wbGUiOiIjQXNzaWduIGNvbHVtbnMgbmFtZXMgZHVyaW5nIGNyZWF0aW9uXG54IDwtIGZhY3RvcihcbiAgeD1jKFwiY2FyXCIsIFwidHJhaW5cIiwgXCJiaWtlXCIsIFwiY2FyXCIsIFwiY2FyXCIpLFxuICBsZXZlbHM9YyhcImNhclwiLFwidHJhaW5cIixcImJpa2VcIixcIndhbGtcIiksXG4gIG9yZGVyZWQ9RkFMU0VcbikgXG5wcmludCh4KVxubW9kZWwubWF0cml4KH4geCAtIDEpIn0= Multiple factors diet <- factor(c(1,1,1,1,2,2,2,2)) sex <- factor(c("f","f","m","m","f","f","m","m")) model.R Tutorial: Using Data Frame in R
https://www.jdatalab.com/data_science_and_data_mining/2020/02/01/R-dataframe.html
Sat, 01 Feb 2020 01:45:03 -0600https://www.jdatalab.com/data_science_and_data_mining/2020/02/01/R-dataframe.htmlThe data.frame object in R groups a number of column vectors into a data set in R. The way data.frame organizes data is similar to that of a spreadsheet, a 2D frame. Tibble is a modern version of classical data.frame which is used in some of R packages. A data.frame is constrained to only hold named columns of the same length.
data.frame is included in the R base. The same data structure is implemented in Python with the module PandasA Beginner Guide to String Pattern Matching in R by Regular Expression: An Example of Text Cleaning
https://www.jdatalab.com/data_science_and_data_mining/2020/01/26/regular-expression-R-text-cleaning.html
Sun, 26 Jan 2020 01:45:03 -0600https://www.jdatalab.com/data_science_and_data_mining/2020/01/26/regular-expression-R-text-cleaning.htmlThis gives a code example of text cleaning with R.The Pipe Operator in R
https://www.jdatalab.com/data_science_and_data_mining/2020/01/23/r-pipe-operator.html
Wed, 22 Jan 2020 01:45:03 -0600https://www.jdatalab.com/data_science_and_data_mining/2020/01/23/r-pipe-operator.htmlThis is the second part of learning regular expressions in R, including escaping characters, special metacharacters, quantifiers, position anchors, operators, character classes, grouping.A Beginner Guide to String Pattern Matching in R by Regular Expression: Grouping and String Replacement
https://www.jdatalab.com/data_science_and_data_mining/2020/01/18/regular-expression-R-grouping.html
Sat, 18 Jan 2020 01:45:03 -0600https://www.jdatalab.com/data_science_and_data_mining/2020/01/18/regular-expression-R-grouping.htmlUse regular expressions in R for grouping and string replacementR Basics
https://www.jdatalab.com/data_science_and_data_mining/2020/01/12/R-basics.html
Sun, 12 Jan 2020 01:45:03 -0600https://www.jdatalab.com/data_science_and_data_mining/2020/01/12/R-basics.htmlThis short tutorial helps you quickly start coding in the R language. It introduces you the environment, packages, reporting and naming and syntax styles.
The R Environment If you bring a laptop to class, you can simply make installations in your laptop.
Otherwise, you may use lab computers but everytime you log in to a different computer, you have to reinstall all the required external packages. To avoid this issue, you can install external packages in a thumb drive and add it to the library path in R.A Beginner Guide to String Pattern Matching in R by Regular Expression Part 2 Examples
https://www.jdatalab.com/data_science_and_data_mining/2017/03/22/regular-expression-R-2.html
Wed, 22 Mar 2017 01:45:03 -0600https://www.jdatalab.com/data_science_and_data_mining/2017/03/22/regular-expression-R-2.htmlSeveral code examples of using regular expressions with R for string processingA Beginner Guide to String Pattern Matching in R by Regular Expression Part 1
https://www.jdatalab.com/data_science_and_data_mining/2017/03/20/regular-expression-R.html
Mon, 20 Mar 2017 01:45:03 -0600https://www.jdatalab.com/data_science_and_data_mining/2017/03/20/regular-expression-R.htmlFormal textual content is a mixture of words and punctuations while online conversational text comes with symbols, emoticons and misspellings. Before performing analysis or building a learning model, data wrangling is a critical step to prepare raw text data into an appropriate format. Text can be considered as a collection of documents and a document can be parsed into strings. In text cleaning, to find, find and remove, and find and replace strings, we write search patterns in regular expressions, commonly abbreviated to regex or regexp).A Beginner Guide to String Pattern Matching in R by Regular Expression Part 1-1
https://www.jdatalab.com/data_science_and_data_mining/2017/03/20/regular-expression-R-part11.html
Mon, 20 Mar 2017 01:45:03 -0600https://www.jdatalab.com/data_science_and_data_mining/2017/03/20/regular-expression-R-part11.htmlThis is the second part of learning regular expressions in R, including escaping characters, special metacharacters, quantifiers, position anchors, operators, character classes, grouping.