Transitioning SQL to dplyr by Djoni Darmawikarta
Author:Djoni Darmawikarta [Darmawikarta, Djoni]
Language: eng
Format: epub
Published: 2017-03-29T07:00:00+00:00
Renaming Column
In SQL you rename output column (a.k.a. column aliasing) as follows.
SELECT column AS renamed_column, … FROM table;
In dplyr, you use the rename function. In the following example we rename hair to hair.colour.
Renaming more than one column
In the following example, eye is renamed eye.color and n is renamed freq.
Derived Column
In SQL’s SELECT we can have a derived (computed) output column.
SELECT *, n/100 FROM table;
In dplyr we use mutate function to add such a column. In the following example we rename the derived column freq/10 into norm.freq.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Access | Data Mining |
Data Modeling & Design | Data Processing |
Data Warehousing | MySQL |
Oracle | Other Databases |
Relational Databases | SQL |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8298)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6730)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6710)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6583)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6368)
Driving Data Quality with Data Contracts by Andrew Jones(6319)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6080)
Learning SQL by Alan Beaulieu(5994)
Weapons of Math Destruction by Cathy O'Neil(5779)
Big Data Analysis with Python by Ivan Marin(5361)
Data Engineering with dbt by Roberto Zagni(4356)
Solidity Programming Essentials by Ritesh Modi(4005)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3863)
Pandas Cookbook by Theodore Petrou(3575)
Blockchain Basics by Daniel Drescher(3292)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2905)
Feature Store for Machine Learning by Jayanth Kumar M J(2814)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2796)
Mastering Python for Finance by Unknown(2744)
