[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573756-105":53,"doc-detail-573756-en":125},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":118,"head_meta":120,"extra_data":122,"updated_unix":124},105,"en","daseh-day-5-cheatsheet-data-cleaning-cheatsheet","DaSEH Day 5 Cheatsheet - Data Cleaning - Cheatsheet","","DaSEH Day 5 Cheatsheet focuses on data cleaning fundamentals and practical checks for missing or abnormal values. It explains NA, NaN (“Not a Number” from 0/0), and Inf/-Inf from division by zero, and introduces tools such as naniar for exploring missingness and tidyverse stringr/tidyr/dplyr functions for detecting and transforming character data and handling missing rows. It summarizes key R functions like is.na(), is.nan(), is.infinite(), pct_complete(), gg_miss_var(), drop_na(), na_if(), replace_na(), case_when(), mutate(), separate(), unite(), str_detect(), str_replace(), str_replace_all(), and str_sub.",{"@graph":63,"@context":117},[64,80,100],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/daseh-day-5-cheatsheet-data-cleaning-cheatsheet/573756/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":94,"encodingFormat":93,"isAccessibleForFree":95,"interactionStatistic":96},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/daseh-day-5-cheatsheet-data-cleaning-cheatsheet/573756.png","ImageObject",442,249,{"name":88,"@type":89},"I feel Different","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-14",true,{"@type":97,"interactionType":98,"userInteractionCount":73},"InteractionCounter",{"@type":99},"ViewAction",{"@type":101,"mainEntity":102},"FAQPage",[103,109,113],{"name":104,"@type":105,"acceptedAnswer":106},"What are NA, NaN, and Inf/-Inf in data cleaning?","Question",{"text":107,"@type":108},"NA represents general missing data. NaN is “Not a Number,” commonly produced by operations like 0/0. Inf and -Inf indicate Infinity, typically occurring when a positive or negative number is divided by 0.","Answer",{"name":110,"@type":105,"acceptedAnswer":111},"Which tools help explore missingness in large datasets?",{"text":112,"@type":108},"The cheatsheet highlights the naniar package, including functions like gg_miss_var() and miss_var_summary() to visualize and report missingness by variable.",{"name":114,"@type":105,"acceptedAnswer":115},"How can tidyverse functions be used to handle missing and transform data?",{"text":116,"@type":108},"It covers drop_na() to drop rows with NA values, na_if() to convert specific values to NA, and replace_na() to substitute NA with a chosen value. It also includes transformations such as mutate(), separate(), and unite(), plus string operations like str_detect(), str_replace(), str_replace_all(), and str_sub().","https://schema.org",{"og:url":78,"og:type":119,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":121,"canonical":78},"index,follow",{"doc_id":123,"site_id":56},573756,1792014311,{"code":4,"msg":5,"data":126},{"doc_id":123,"user_id":127,"nickname":88,"user_avatar":128,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":129,"file_id":130,"file_url":131,"file_type":132,"file_size":133,"view_count":73,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":134,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":135,"faqs":136,"seo_title":137,"seo_description":61,"update_tm":138,"read_time":9},962093541761,"https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","DaSEH Day 5 Cheatsheet  \nData Cleaning  \nMajor concepts  \n• Most important rule of data handling: Always look at your data.  \n• NA: General missing data.  \n• NaN: “Not a Number”; occurs when you calculate 0/0 .  \n• Inf and-Inf: Infinity; occurs when you divide a positive or negative number by 0.  \n• naniar: Useful for exploring missingness in large datasets. See the naniar package.  \n• tidyverse (stringr): Useful for detecting and working with parts of character values, especially with filter() and str_detect() .  \nExamples  \nExample of case_when() with mutate() :  \nOrange | >  \nmutate (old = case_when ( age > 1000 ~ TRUE ,.default = FALSE  \n))  \nFunctions  \nLibrary/Package  \nPiece of code  \nExample of usage  \nWhat it does  \nBase R  \nBase R  \nBase Rnaniar  \n[is.na](is.na) ()  \nis.nan()  \nis.infinite() pct_complete()  \n[is.na](is.na) (x) any( [is.na](is.na) (x)) is.nan(x)  \nis.infinite(x) pct_complete(x)  \nChecks if x is NA. With any(), checks if any values are NA.  \nChecks if x is NaN.  \nChecks if x is Inf or-Inf.  \nReports the percentage of complete data in x.  \n\n| Library/Package | Piece of code | Example of usage | What it does |\n| --- | --- | --- | --- |\n| naniar | gg_miss_var() | gg_miss_var(x) | Plots the percentage of missing data by variable in x. |\n| naniar | miss_var_summary() | miss_var_summary(x) | Reports the percentage of missing data by variable in x. |\n| naniar | miss_var_which() | miss_var_which(x) | Returns variable names that contain |\n| tidyverse (tidyr) | drop_na(df) | drop_na(df)\u003Cbr>drop_na(variable) | missing values in x.\u003Cbr>Drops rows with NA values. When a variable is specified, only drops rows where that variable is NA. |\n| tidyverse (dplyr) | na_if() | na_if(vector, value) | Converts specified values to NA. Use with mutate() . |\n| tidyverse (tidyr) | replace_na() | replace_na(vector, value) | Replaces NA values with a specified value. Use with mutate() . |\n| tidyverse (dplyr) | case_when() | case_when(test ~ outcome, .default = x) | Vectorizes multiple if_else() statements. If no cases match, NA is returned unless |\n| tidyverse (dplyr) | mutate() | df \u003C -mutate(df, newcol = wt / 2 .2) | .default is specified. Use with mutate() . Adds a new column based on existing columns. |\n| tidyverse (tidyr) | separate() | df |> separate(x, c(\"A\", \"B\")) | Separates one character column into multiple columns using a regular expression or numeric locations. |\n| tidyverse (tidyr) | unite() | df | > unite(\"z\", x:y, remove = FALSE) | Unites multiple columns into one column. |\n| tidyverse (stringr) | str_detect() | df |> filter(str_detect(col_name,\"string_pattern\")) | Returns a logical vector indicating whether a string pattern was detected. |\n| tidyverse (stringr) | str_replace() | str_replace(string = vector,\"replace_me\", \"with_me\") | Replaces the first instance of one specified string with another. |\n| tidyverse (stringr) | str_replace_all() | str_replace_all(string = vector,\"replace_me\", \"with_me\") | Replaces all instances of one specified string with another. |\n| tidyverse (stringr) | str_sub() | str_sub(string = vector, start = 1, end = 3) | Subsets a string to the specified character positions. |\n\n* This cheatsheet format was adapted from Alex’s Lemonade Stand materials (source) .  \n* Find more resources at [https://daseh.org](https://daseh.org).","cbCaiuIVIvDWcjqC","https://ap.wps.com/l/cbCaiuIVIvDWcjqC","pdf",166544,"English","# Data Cleaning\n## Major concepts\n## Examples and core functions\n## Libraries and functions","[{\"question\":\"What are NA, NaN, and Inf/-Inf in data cleaning?\",\"answer\":\"NA represents general missing data. NaN is “Not a Number,” commonly produced by operations like 0/0. Inf and -Inf indicate Infinity, typically occurring when a positive or negative number is divided by 0.\"},{\"question\":\"Which tools help explore missingness in large datasets?\",\"answer\":\"The cheatsheet highlights the naniar package, including functions like gg_miss_var() and miss_var_summary() to visualize and report missingness by variable.\"},{\"question\":\"How can tidyverse functions be used to handle missing and transform data?\",\"answer\":\"It covers drop_na() to drop rows with NA values, na_if() to convert specific values to NA, and replace_na() to substitute NA with a chosen value. It also includes transformations such as mutate(), separate(), and unite(), plus string operations like str_detect(), str_replace(), str_replace_all(), and str_sub().\"}]","DaSEH Day 5 Cheatsheet - Data Cleaning - Cheatsheet | PDF",1791945042]