04b basic data management
TRANSCRIPT
8/19/2019 04b Basic Data Management
http://slidepdf.com/reader/full/04b-basic-data-management 1/6
Data Analysis & DataScience with R
Basic Data Management
By Marin Fotache
Al.I. Cuza University of Iași
Faculty of Economics and Business Administration
Department of Accounting, Information ystems andtatistics
8/19/2019 04b Basic Data Management
http://slidepdf.com/reader/full/04b-basic-data-management 2/6
R script associated with thispresentation
!"#$#asic$data$management.%
&ttp'(()drv.ms()*UUu+
8/19/2019 04b Basic Data Management
http://slidepdf.com/reader/full/04b-basic-data-management 3/6
Topics
Adding column(varia#les◦ New columns defined through expresssions
◦ Function transform
%emoving varia#les -columns◦ Directly, e.g. invoices_2 <- invoices_1[-10]
◦ Directly, e.g. df$column.to.remove <- NULL
◦
Indirecty (by copying a data frame and specifiyng thevariables NO to be removed!
◦ "ith function remove.vars from pac#age gdata
◦ "ith function Varro! from pac#age ata"om#ine
8/19/2019 04b Basic Data Management
http://slidepdf.com/reader/full/04b-basic-data-management 4/6
Topics (cont.)
%ecoding varia#les -values◦ $ecode with filter (subsetting!
◦ Divide continuous variable x into factor with n levels%
cut%& n'
◦ Divides a continuous variable x into n intervals by
selecting n&' eually spaced rounded values (pretty
brea#points!% !rett(%& n'
%enaming varia#les -columns
◦ "ith function names
◦ "ith function rename from pac#age res)a!e
◦ "ith function rename.vars from pac#age gdata
8/19/2019 04b Basic Data Management
http://slidepdf.com/reader/full/04b-basic-data-management 5/6
Topics (cont.)
C&ange order of t&e columns◦ "hen copy a data frame
◦ "ith function *ove+ront from pac#age ata"om#ine
u#setting data frames
◦ )sing suare brac#ets [ ]
◦ "ith function ,)ic)
◦ "ith function su#set
orting data
Uni/ue and duplicated values
Data sampling
Basic 0descriptive0 functions
8/19/2019 04b Basic Data Management
http://slidepdf.com/reader/full/04b-basic-data-management 6/6
We sites!"ideo#t$torials %or BasicData Management
*ecture 1#' u#setting&ttps'((222.youtu#e.com(2atc&3v4&5#g/
zs67F!8inde94:8list4;*<=l9#>2?v@;/y
FD+/Ia5uEDy>du#setting Data in % 5it& /uare
Bracets and *ogic tatements -% =utorial
).
&ttps'((222.youtu#e.com(2atc&3v4<+fG5
H&>*@8list4;*/zo*:>e7=HBDd?g7g7za6c
@ms@AU8inde94Gu#setting Data in % 5it& /uare