diff --git a/index.html b/index.html index 53dffe2..0366fda 100644 --- a/index.html +++ b/index.html @@ -157,6 +157,7 @@
data <- data.frame(dates = rep(Sys.time(), 10))
data$dates
-#> [1] "2024-12-03 23:00:25 UTC" "2024-12-03 23:00:25 UTC"
-#> [3] "2024-12-03 23:00:25 UTC" "2024-12-03 23:00:25 UTC"
-#> [5] "2024-12-03 23:00:25 UTC" "2024-12-03 23:00:25 UTC"
-#> [7] "2024-12-03 23:00:25 UTC" "2024-12-03 23:00:25 UTC"
-#> [9] "2024-12-03 23:00:25 UTC" "2024-12-03 23:00:25 UTC"
+#> [1] "2024-12-03 23:03:51 UTC" "2024-12-03 23:03:51 UTC"
+#> [3] "2024-12-03 23:03:51 UTC" "2024-12-03 23:03:51 UTC"
+#> [5] "2024-12-03 23:03:51 UTC" "2024-12-03 23:03:51 UTC"
+#> [7] "2024-12-03 23:03:51 UTC" "2024-12-03 23:03:51 UTC"
+#> [9] "2024-12-03 23:03:51 UTC" "2024-12-03 23:03:51 UTC"
attr(data$dates, "tzone")
#> NULL
messy <- messy_datetime_tzones(data, tzones = "Poland")
messy$dates
-#> [1] "2024-12-04 00:00:25 CET" "2024-12-04 00:00:25 CET"
-#> [3] "2024-12-04 00:00:25 CET" "2024-12-04 00:00:25 CET"
-#> [5] "2024-12-04 00:00:25 CET" "2024-12-04 00:00:25 CET"
-#> [7] "2024-12-04 00:00:25 CET" "2024-12-04 00:00:25 CET"
-#> [9] "2024-12-04 00:00:25 CET" "2024-12-04 00:00:25 CET"
+#> [1] "2024-12-04 00:03:51 CET" "2024-12-04 00:03:51 CET"
+#> [3] "2024-12-04 00:03:51 CET" "2024-12-04 00:03:51 CET"
+#> [5] "2024-12-04 00:03:51 CET" "2024-12-04 00:03:51 CET"
+#> [7] "2024-12-04 00:03:51 CET" "2024-12-04 00:03:51 CET"
+#> [9] "2024-12-04 00:03:51 CET" "2024-12-04 00:03:51 CET"
attr(messy$dates, "tzone")
#> [1] "Poland"
diff --git a/reference/split-dates.html b/reference/split-dates.html
index 83d7026..ef5f95c 100644
--- a/reference/split-dates.html
+++ b/reference/split-dates.html
@@ -100,7 +100,7 @@ Examplesdata <- data.frame(today = Sys.time())
split_datetimes(data)
#> today_date today_time
-#> 1 2024/12/03 23:00:26
+#> 1 2024/12/03 23:03:52
# split dates
data <- data.frame(today = Sys.Date())
data
diff --git a/search.json b/search.json
index e62aaef..5142f4e 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://nrennie.rbind.io/messy/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nicola Rennie. Author, maintainer, copyright holder.","code":""},{"path":"https://nrennie.rbind.io/messy/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Rennie N (2024). messy: Create Messy Data Clean Data Frames. R package version 0.1.0.9000, https://github.com/nrennie/messy, https://nrennie.rbind.io/messy/.","code":"@Manual{, title = {messy: Create Messy Data from Clean Data Frames}, author = {Nicola Rennie}, year = {2024}, note = {R package version 0.1.0.9000, https://github.com/nrennie/messy}, url = {https://nrennie.rbind.io/messy/}, }"},{"path":"https://nrennie.rbind.io/messy/index.html","id":"messy-","dir":"","previous_headings":"","what":"Create Messy Data from Clean Data Frames","title":"Create Messy Data from Clean Data Frames","text":"teaching examples using R, instructors often using nice datasets - aren’t realistic, aren’t students later encounter real world. Real datasets typos, missing values encoded strange ways, weird spaces. {messy} R package takes clean dataset, randomly adds things - giving students opportunity practice data cleaning wrangling skills without change examples.","code":""},{"path":"https://nrennie.rbind.io/messy/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Create Messy Data from Clean Data Frames","text":"Install CRAN using: Install development version GitHub using:","code":"install.packages(\"messy\") remotes::install_github(\"nrennie/messy\")"},{"path":"https://nrennie.rbind.io/messy/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Create Messy Data from Clean Data Frames","text":"-depth usage instructions, see package documentation nrennie.rbind.io/messy examples function. simplest way use {messy} package applying messy() function: can vary amount messiness function, chain together different functions create customised messy data:","code":"set.seed(1234) messy(ToothGrowth[1:10,]) len supp dose 1 4.2 VC 0.5 2 11.5 3 7.3 VC 0.5 4 5.8 (VC 0.5 5 6.4 VC 6 10 VC 0.5 7 11.2 0.5 8 11.2 VC 0.5 9 5.2 VC 0.5 10 7 VC 0.5 set.seed(1234) ToothGrowth[1:10,] |> make_missing(cols = \"supp\", missing = \" \") |> make_missing(cols = c(\"len\", \"dose\"), missing = c(NA, 999)) |> add_whitespace(cols = \"supp\", messiness = 0.5) |> add_special_chars(cols = \"supp\") len supp dose 1 4.2 VC 0.5 2 11.5 VC NA 3 7.3 VC 0.5 4 5.8 *VC 0.5 5 6.4 VC 0.5 6 10.0 VC 0.5 7 11.2 0.5 8 11.2 V#C NA 9 5.2 !VC 0.5 10 7.0 VC* 0.5"},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":null,"dir":"Reference","previous_headings":"","what":"Add special characters to strings — add_special_chars","title":"Add special characters to strings — add_special_chars","text":"Add special characters strings","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add special characters to strings — add_special_chars","text":"","code":"add_special_chars(data, cols = NULL, messiness = 0.1)"},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add special characters to strings — add_special_chars","text":"data input dataframe cols set columns apply transformation . NULL apply columns. Default NULL. messiness Percentage values change. Must 0 1. Default 0.1.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add special characters to strings — add_special_chars","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add special characters to strings — add_special_chars","text":"","code":"add_special_chars(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":null,"dir":"Reference","previous_headings":"","what":"Add whitespaces — add_whitespace","title":"Add whitespaces — add_whitespace","text":"Randomly add whitespaces end values subset columns.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add whitespaces — add_whitespace","text":"","code":"add_whitespace(data, cols = NULL, messiness = 0.1)"},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add whitespaces — add_whitespace","text":"data input dataframe cols set columns apply transformation . NULL apply columns. Default NULL. messiness Percentage values change. Must 0 1. Default 0.1.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add whitespaces — add_whitespace","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add whitespaces — add_whitespace","text":"","code":"add_whitespace(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21 6 160 110 3.9 2.62 16.46 0 1 4 4 #> Mazda RX4 Wag 21 6 160 110 3.9 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108 93 3.85 2.32 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360 175 3.15 3.44 17.02 0 0 3 2 #> Valiant 18.1 6 225 105 2.76 3.46 20.22 1 0 3 1 #> Duster 360 14.3 8 360 245 3.21 3.57 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.19 20 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.44 18.3 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.44 18.9 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.07 17.4 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.73 17.6 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.78 18 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472 205 2.93 5.25 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460 215 3 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.2 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.9 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.7 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318 150 2.76 3.52 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304 150 3.15 3.435 17.3 0 0 3 2 #> Camaro Z28 13.3 8 350 245 3.73 3.84 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79 66 4.08 1.935 18.9 1 1 4 1 #> Porsche 914-2 26 4 120.3 91 4.43 2.14 16.7 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.9 1 1 5 2 #> Ford Pantera L 15.8 8 351 264 4.22 3.17 14.5 0 1 5 4 #> Ferrari Dino 19.7 6 145 175 3.62 2.77 15.5 0 1 5 6 #> Maserati Bora 15 8 301 335 3.54 3.57 14.6 0 1 5 8 #> Volvo 142E 21.4 4 121 109 4.11 2.78 18.6 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":null,"dir":"Reference","previous_headings":"","what":"Change case — change_case","title":"Change case — change_case","text":"Randomly switch title case lowercase character strings","code":""},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change case — change_case","text":"","code":"change_case(data, cols = NULL, messiness = 0.1, case_type = \"word\")"},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change case — change_case","text":"data input dataframe cols set columns apply transformation . NULL apply columns. Default NULL. messiness Percentage values change. Must 0 1. Default 0.1. case_type Whether case change based \"word\" \"letter\".","code":""},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Change case — change_case","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change case — change_case","text":"","code":"change_case(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":null,"dir":"Reference","previous_headings":"","what":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"Duplicate rows insert dataframe order random","code":""},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"","code":"duplicate_rows(data, messiness = 0.1, shuffle = FALSE)"},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"data input dataframe messiness Percentage rows duplicate. Must 0 1. Default 0.1. shuffle Insert duplicated data underneath original data insert randomly","code":""},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"dataframe duplicated rows inserted","code":""},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"Philip Leftwich","code":""},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"","code":"duplicate_rows(mtcars, messiness = 0.1) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout...5 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Hornet Sportabout...6 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant...7 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Valiant...8 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360...9 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Duster 360...10 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9...29 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Fiat X1-9...30 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Make missing — make_missing","title":"Make missing — make_missing","text":"Randomly make values missing data columns, subset columns","code":""},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make missing — make_missing","text":"","code":"make_missing(data, cols = NULL, messiness = 0.1, missing = NA)"},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make missing — make_missing","text":"data input dataframe cols set columns apply transformation . NULL apply columns. Default NULL. messiness Percentage values change. Must 0 1. Default 0.1. missing single value, vector, list missing values replaced . length greater 1, values replaced randomly. Default NA.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make missing — make_missing","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make missing — make_missing","text":"","code":"make_missing(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag NA 6 160.0 NA 3.90 2.875 17.02 0 1 NA 4 #> Datsun 710 22.8 4 108.0 93 NA 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 NA 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 NA 175 3.15 3.440 NA 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 NA 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 NA 0 4 2 #> Merc 230 22.8 4 NA 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 NA 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 NA 3.440 18.90 1 NA 4 4 #> Merc 450SE NA 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 NA 180 3.07 NA 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 NA #> Cadillac Fleetwood 10.4 8 472.0 NA 2.93 5.250 17.98 0 0 3 NA #> Lincoln Continental 10.4 NA 460.0 215 NA 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 NA #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 NA #> Toyota Corona NA 4 120.1 97 3.70 2.465 20.01 NA 0 NA 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 NA 304.0 150 NA 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 NA 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 NA 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L NA 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino NA 6 145.0 175 NA 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 NA 109 4.11 2.780 18.60 NA 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":null,"dir":"Reference","previous_headings":"","what":"Make date(time) formats inconsistent — messy_datetime_formats","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"Takes date(times) column transforms character column, sampling number random valid character representations.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"","code":"messy_datetime_formats( data, cols = NULL, formats = c(\"%Y/%m/%d %H:%M:%S\", \"%d/%m/%Y %H:%M:%S\") ) messy_date_formats( data, cols = NULL, formats = c(\"%Y/%m/%d\", \"%d/%m/%Y\") )"},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"data input dataframe cols set columns apply transformation . NULL apply POSIXt columns (messy_datetime_formats()) Date columns (messy_date_formats()). formats vector number valid strptime() formats. Multiple formats sampled random.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"dataframe size input data.","code":""},{"path":[]},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"Jack Davison","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"","code":"data <- data.frame(dates = rep(Sys.Date(), 10)) messy_date_formats(data) #> dates #> 1 03/12/2024 #> 2 2024/12/03 #> 3 2024/12/03 #> 4 2024/12/03 #> 5 2024/12/03 #> 6 2024/12/03 #> 7 2024/12/03 #> 8 2024/12/03 #> 9 03/12/2024 #> 10 2024/12/03"},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":null,"dir":"Reference","previous_headings":"","what":"Messy — messy","title":"Messy — messy","text":"Make data frame messier.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Messy — messy","text":"","code":"messy(data, messiness = 0.1, missing = NA, case_type = \"word\")"},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Messy — messy","text":"data input dataframe messiness Percentage values change per function. Must 0 1. Default 0.1. missing single value, vector, list missing values replaced . length greater 1, values replaced randomly. Default NA. case_type Whether case change based \"word\" \"letter\".","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Messy — messy","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Messy — messy","text":"","code":"messy(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear #> Mazda RX4 6 160 110 3.9 2.62 16.46 0 1 4 #> Mazda RX4 Wag 21 6 160 110 3.9 2.875 17.02 0 1 4 #> Datsun 710 22.8 4 108 93 3.85 2.32 18.61 1 1 4 #> Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 #> Hornet Sportabout 18.7 8 360 175 3.15 3.44 0 0 3 #> Valiant 18.1 6 225 105 2.76 3.46 20.22 1 0 #> Duster 360 8 360 245 3.21 3.57 15.84 0 3 #> Merc 240D 24.4 4 146.7 62 3.69 3.19 20 1 0 4 #> Merc 230 22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 #> Merc 280 19.2 6 167.6 123 3.92 3.44 18.3 1 0 #> Merc 280C 17.8 6 167.6 3.92 3.44 18.9 1 0 4 #> Merc 450SE 8 275.8 180 3.07 17.4 0 3 #> Merc 450SL 17.3 8 275.8 3.07 3.73 17.6 0 0 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.78 18 0 3 #> Cadillac Fleetwood 10.4 8 472 205 2.93 5.25 0 #> Lincoln Continental 8 460 215 3 5.424 17.82 0 3 #> Chrysler Imperial 14.7 8 230 3.23 5.345 17.42 0 3 #> Fiat 128 32.4 4 78.7 4.08 2.2 19.47 1 4 #> Honda Civic 30.4 52 4.93 1.615 18.52 1 4 #> Toyota Corolla 33.9 4 65 4.22 1.835 19.9 1 1 4 #> Toyota Corona 21.5 4 120.1 97 3.7 2.465 20.01 1 3 #> Dodge Challenger 15.5 8 318 2.76 3.52 16.87 0 0 3 #> AMC Javelin 8 304 150 3.15 3.435 17.3 0 0 #> Camaro Z28 13.3 8 350 245 3.73 3.84 15.41 0 0 3 #> Pontiac Firebird 19.2 8 400 175 3.08 3.845 17.05 0 0 3 #> Fiat X1-9 27.3 4 79 66 4.08 1.935 18.9 1 1 4 #> Porsche 914-2 26 4 4.43 2.14 0 1 5 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.9 1 1 5 #> Ford Pantera L 15.8 8 351 264 4.22 3.17 14.5 0 1 #> Ferrari Dino 6 145 175 2.77 0 1 5 #> Maserati Bora 15 8 301 3.54 3.57 14.6 0 1 5 #> Volvo 142E 21.4 4 121 109 4.11 2.78 18.6 1 1 4 #> carb #> Mazda RX4 4 #> Mazda RX4 Wag 4 #> Datsun 710 1 #> Hornet 4 Drive 1 #> Hornet Sportabout 2 #> Valiant 1 #> Duster 360 4 #> Merc 240D 2 #> Merc 230 2 #> Merc 280 4 #> Merc 280C 4 #> Merc 450SE 3 #> Merc 450SL 3 #> Merc 450SLC 3 #> Cadillac Fleetwood 4 #> Lincoln Continental 4 #> Chrysler Imperial #> Fiat 128 1 #> Honda Civic #> Toyota Corolla 1 #> Toyota Corona 1 #> Dodge Challenger #> AMC Javelin 2 #> Camaro Z28 4 #> Pontiac Firebird 2 #> Fiat X1-9 1 #> Porsche 914-2 2 #> Lotus Europa 2 #> Ford Pantera L 4 #> Ferrari Dino 6 #> Maserati Bora #> Volvo 142E 2"},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":null,"dir":"Reference","previous_headings":"","what":"Make column names messy — messy_colnames","title":"Make column names messy — messy_colnames","text":"Adds special characters randomly capitalises characters column names data frame.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make column names messy — messy_colnames","text":"","code":"messy_colnames(data, messiness = 0.2)"},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make column names messy — messy_colnames","text":"data data.frame alter column names messiness Percentage values change per function. Must 0 1. Default 0.1.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make column names messy — messy_colnames","text":"data.frame messy column names","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Make column names messy — messy_colnames","text":"Athanasia Monika Mowinckel","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make column names messy — messy_colnames","text":"","code":"messy_colnames(mtcars) #> mpg cyl -disp hp drat w.t QSEC vs am GEAR $c.arb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":null,"dir":"Reference","previous_headings":"","what":"Change the timezone of datetime columns — messy_datetime_tzones","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"Takes number datetime columns changes timezones either totally random, user-provided list timezones.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"","code":"messy_datetime_tzones(data, cols = NULL, tzones = OlsonNames(), force = FALSE)"},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"data input dataframe cols set columns apply transformation . NULL apply POSIXt columns. tzones Valid time zones sample . default samples OlsonNames(), can set options relevant data. force default (force = FALSE) datetimes actual hour/minute values changed along timezones. force = TRUE, requires lubridate, datetime values remain timezone differ.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"dataframe size input data.","code":""},{"path":[]},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"Jack Davison","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"","code":"data <- data.frame(dates = rep(Sys.time(), 10)) data$dates #> [1] \"2024-12-03 23:00:25 UTC\" \"2024-12-03 23:00:25 UTC\" #> [3] \"2024-12-03 23:00:25 UTC\" \"2024-12-03 23:00:25 UTC\" #> [5] \"2024-12-03 23:00:25 UTC\" \"2024-12-03 23:00:25 UTC\" #> [7] \"2024-12-03 23:00:25 UTC\" \"2024-12-03 23:00:25 UTC\" #> [9] \"2024-12-03 23:00:25 UTC\" \"2024-12-03 23:00:25 UTC\" attr(data$dates, \"tzone\") #> NULL messy <- messy_datetime_tzones(data, tzones = \"Poland\") messy$dates #> [1] \"2024-12-04 00:00:25 CET\" \"2024-12-04 00:00:25 CET\" #> [3] \"2024-12-04 00:00:25 CET\" \"2024-12-04 00:00:25 CET\" #> [5] \"2024-12-04 00:00:25 CET\" \"2024-12-04 00:00:25 CET\" #> [7] \"2024-12-04 00:00:25 CET\" \"2024-12-04 00:00:25 CET\" #> [9] \"2024-12-04 00:00:25 CET\" \"2024-12-04 00:00:25 CET\" attr(messy$dates, \"tzone\") #> [1] \"Poland\""},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":null,"dir":"Reference","previous_headings":"","what":"Splits date(time) column(s) into multiple columns — split_datetimes","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"functions can split \"date\" \"time\" components POSIXt columns \"hour\", \"month\", \"day\" components Date columns multiple columns.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"","code":"split_datetimes(data, cols = NULL, class = c(\"character\", \"date\")) split_dates(data, cols = NULL)"},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"data input dataframe cols set columns apply transformation . NULL apply POSIXt columns (split_datetimes()) Date columns (split_dates()). class split_datetimes(). desired output separate \"date\" \"time\" columns. \"character\" leaves columns character vectors. \"date\" reformat date \"Date\" time \"POSIXct\" object, dummy date appended . split_dates(), returned columns integers.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"dataframe","code":""},{"path":[]},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"Jack Davison","code":""},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"","code":"# split datetimes data <- data.frame(today = Sys.time()) split_datetimes(data) #> today_date today_time #> 1 2024/12/03 23:00:26 # split dates data <- data.frame(today = Sys.Date()) data #> today #> 1 2024-12-03 split_dates(data) #> today_year today_month today_day #> 1 2024 12 3"},{"path":[]},{"path":"https://nrennie.rbind.io/messy/news/index.html","id":"messy-010","dir":"Changelog","previous_headings":"","what":"messy 0.1.0","title":"messy 0.1.0","text":"CRAN release: 2024-12-03 CRAN release Add duplicate_rows() function messy_datetime_tzones() randomly set different timezones datetime columns messy_datetime_formats() messy_date_formats() format date(times) characters, scramble strptime formats. split_datetimes() split_dates() split datetime columns “date” “time” columns, Date columns “year”, “month”, “day” columns.","code":""},{"path":"https://nrennie.rbind.io/messy/news/index.html","id":"messy-002","dir":"Changelog","previous_headings":"","what":"messy 0.0.2","title":"messy 0.0.2","text":"Add pkgdown site Add lintr file Add messy_colnames() function Add messy_strings() function","code":""},{"path":"https://nrennie.rbind.io/messy/news/index.html","id":"messy-001","dir":"Changelog","previous_headings":"","what":"messy 0.0.1","title":"messy 0.0.1","text":"Add add_whitespaces() function Add make_missing() function Add change_case() function Add initial messy() function Package initialisation","code":""}]
+[{"path":"https://nrennie.rbind.io/messy/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Nicola Rennie. Author, maintainer, copyright holder.","code":""},{"path":"https://nrennie.rbind.io/messy/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Rennie N (2024). messy: Create Messy Data Clean Data Frames. R package version 0.1.0.9000, https://github.com/nrennie/messy, https://nrennie.rbind.io/messy/.","code":"@Manual{, title = {messy: Create Messy Data from Clean Data Frames}, author = {Nicola Rennie}, year = {2024}, note = {R package version 0.1.0.9000, https://github.com/nrennie/messy}, url = {https://nrennie.rbind.io/messy/}, }"},{"path":"https://nrennie.rbind.io/messy/index.html","id":"messy-","dir":"","previous_headings":"","what":"Create Messy Data from Clean Data Frames","title":"Create Messy Data from Clean Data Frames","text":"teaching examples using R, instructors often using nice datasets - aren’t realistic, aren’t students later encounter real world. Real datasets typos, missing values encoded strange ways, weird spaces. {messy} R package takes clean dataset, randomly adds things - giving students opportunity practice data cleaning wrangling skills without change examples.","code":""},{"path":"https://nrennie.rbind.io/messy/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Create Messy Data from Clean Data Frames","text":"Install CRAN using: Install development version GitHub using:","code":"install.packages(\"messy\") remotes::install_github(\"nrennie/messy\")"},{"path":"https://nrennie.rbind.io/messy/index.html","id":"usage","dir":"","previous_headings":"","what":"Usage","title":"Create Messy Data from Clean Data Frames","text":"-depth usage instructions, see package documentation nrennie.rbind.io/messy examples function. simplest way use {messy} package applying messy() function: can vary amount messiness function, chain together different functions create customised messy data:","code":"set.seed(1234) messy(ToothGrowth[1:10,]) len supp dose 1 4.2 VC 0.5 2 11.5 3 7.3 VC 0.5 4 5.8 (VC 0.5 5 6.4 VC 6 10 VC 0.5 7 11.2 0.5 8 11.2 VC 0.5 9 5.2 VC 0.5 10 7 VC 0.5 set.seed(1234) ToothGrowth[1:10,] |> make_missing(cols = \"supp\", missing = \" \") |> make_missing(cols = c(\"len\", \"dose\"), missing = c(NA, 999)) |> add_whitespace(cols = \"supp\", messiness = 0.5) |> add_special_chars(cols = \"supp\") len supp dose 1 4.2 VC 0.5 2 11.5 VC NA 3 7.3 VC 0.5 4 5.8 *VC 0.5 5 6.4 VC 0.5 6 10.0 VC 0.5 7 11.2 0.5 8 11.2 V#C NA 9 5.2 !VC 0.5 10 7.0 VC* 0.5"},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":null,"dir":"Reference","previous_headings":"","what":"Add special characters to strings — add_special_chars","title":"Add special characters to strings — add_special_chars","text":"Add special characters strings","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add special characters to strings — add_special_chars","text":"","code":"add_special_chars(data, cols = NULL, messiness = 0.1)"},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add special characters to strings — add_special_chars","text":"data input dataframe cols set columns apply transformation . NULL apply columns. Default NULL. messiness Percentage values change. Must 0 1. Default 0.1.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add special characters to strings — add_special_chars","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_special_chars.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add special characters to strings — add_special_chars","text":"","code":"add_special_chars(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":null,"dir":"Reference","previous_headings":"","what":"Add whitespaces — add_whitespace","title":"Add whitespaces — add_whitespace","text":"Randomly add whitespaces end values subset columns.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add whitespaces — add_whitespace","text":"","code":"add_whitespace(data, cols = NULL, messiness = 0.1)"},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add whitespaces — add_whitespace","text":"data input dataframe cols set columns apply transformation . NULL apply columns. Default NULL. messiness Percentage values change. Must 0 1. Default 0.1.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Add whitespaces — add_whitespace","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/add_whitespace.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Add whitespaces — add_whitespace","text":"","code":"add_whitespace(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21 6 160 110 3.9 2.62 16.46 0 1 4 4 #> Mazda RX4 Wag 21 6 160 110 3.9 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108 93 3.85 2.32 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360 175 3.15 3.44 17.02 0 0 3 2 #> Valiant 18.1 6 225 105 2.76 3.46 20.22 1 0 3 1 #> Duster 360 14.3 8 360 245 3.21 3.57 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.19 20 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.44 18.3 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.44 18.9 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.07 17.4 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.73 17.6 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.78 18 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472 205 2.93 5.25 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460 215 3 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.2 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.9 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.7 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318 150 2.76 3.52 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304 150 3.15 3.435 17.3 0 0 3 2 #> Camaro Z28 13.3 8 350 245 3.73 3.84 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79 66 4.08 1.935 18.9 1 1 4 1 #> Porsche 914-2 26 4 120.3 91 4.43 2.14 16.7 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.9 1 1 5 2 #> Ford Pantera L 15.8 8 351 264 4.22 3.17 14.5 0 1 5 4 #> Ferrari Dino 19.7 6 145 175 3.62 2.77 15.5 0 1 5 6 #> Maserati Bora 15 8 301 335 3.54 3.57 14.6 0 1 5 8 #> Volvo 142E 21.4 4 121 109 4.11 2.78 18.6 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":null,"dir":"Reference","previous_headings":"","what":"Change case — change_case","title":"Change case — change_case","text":"Randomly switch title case lowercase character strings","code":""},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change case — change_case","text":"","code":"change_case(data, cols = NULL, messiness = 0.1, case_type = \"word\")"},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change case — change_case","text":"data input dataframe cols set columns apply transformation . NULL apply columns. Default NULL. messiness Percentage values change. Must 0 1. Default 0.1. case_type Whether case change based \"word\" \"letter\".","code":""},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Change case — change_case","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/change_case.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change case — change_case","text":"","code":"change_case(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":null,"dir":"Reference","previous_headings":"","what":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"Duplicate rows insert dataframe order random","code":""},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"","code":"duplicate_rows(data, messiness = 0.1, shuffle = FALSE)"},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"data input dataframe messiness Percentage rows duplicate. Must 0 1. Default 0.1. shuffle Insert duplicated data underneath original data insert randomly","code":""},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"dataframe duplicated rows inserted","code":""},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"Philip Leftwich","code":""},{"path":"https://nrennie.rbind.io/messy/reference/duplicate_rows.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Duplicate rows and insert them into the dataframe in order or at random — duplicate_rows","text":"","code":"duplicate_rows(mtcars, messiness = 0.1) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout...5 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Hornet Sportabout...6 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant...7 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Valiant...8 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360...9 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Duster 360...10 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9...29 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Fiat X1-9...30 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Make missing — make_missing","title":"Make missing — make_missing","text":"Randomly make values missing data columns, subset columns","code":""},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make missing — make_missing","text":"","code":"make_missing(data, cols = NULL, messiness = 0.1, missing = NA)"},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make missing — make_missing","text":"data input dataframe cols set columns apply transformation . NULL apply columns. Default NULL. messiness Percentage values change. Must 0 1. Default 0.1. missing single value, vector, list missing values replaced . length greater 1, values replaced randomly. Default NA.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make missing — make_missing","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/make_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make missing — make_missing","text":"","code":"make_missing(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear carb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag NA 6 160.0 NA 3.90 2.875 17.02 0 1 NA 4 #> Datsun 710 22.8 4 108.0 93 NA 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 NA 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 NA 175 3.15 3.440 NA 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 NA 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 NA 0 4 2 #> Merc 230 22.8 4 NA 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 NA 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 NA 3.440 18.90 1 NA 4 4 #> Merc 450SE NA 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 NA 180 3.07 NA 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 NA #> Cadillac Fleetwood 10.4 8 472.0 NA 2.93 5.250 17.98 0 0 3 NA #> Lincoln Continental 10.4 NA 460.0 215 NA 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 NA #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 NA #> Toyota Corona NA 4 120.1 97 3.70 2.465 20.01 NA 0 NA 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 NA 304.0 150 NA 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 NA 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 NA 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L NA 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino NA 6 145.0 175 NA 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 NA 109 4.11 2.780 18.60 NA 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":null,"dir":"Reference","previous_headings":"","what":"Make date(time) formats inconsistent — messy_datetime_formats","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"Takes date(times) column transforms character column, sampling number random valid character representations.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"","code":"messy_datetime_formats( data, cols = NULL, formats = c(\"%Y/%m/%d %H:%M:%S\", \"%d/%m/%Y %H:%M:%S\") ) messy_date_formats( data, cols = NULL, formats = c(\"%Y/%m/%d\", \"%d/%m/%Y\") )"},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"data input dataframe cols set columns apply transformation . NULL apply POSIXt columns (messy_datetime_formats()) Date columns (messy_date_formats()). formats vector number valid strptime() formats. Multiple formats sampled random.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"dataframe size input data.","code":""},{"path":[]},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"Jack Davison","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy-date-fmt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make date(time) formats inconsistent — messy_datetime_formats","text":"","code":"data <- data.frame(dates = rep(Sys.Date(), 10)) messy_date_formats(data) #> dates #> 1 03/12/2024 #> 2 2024/12/03 #> 3 2024/12/03 #> 4 2024/12/03 #> 5 2024/12/03 #> 6 2024/12/03 #> 7 2024/12/03 #> 8 2024/12/03 #> 9 03/12/2024 #> 10 2024/12/03"},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":null,"dir":"Reference","previous_headings":"","what":"Messy — messy","title":"Messy — messy","text":"Make data frame messier.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Messy — messy","text":"","code":"messy(data, messiness = 0.1, missing = NA, case_type = \"word\")"},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Messy — messy","text":"data input dataframe messiness Percentage values change per function. Must 0 1. Default 0.1. missing single value, vector, list missing values replaced . length greater 1, values replaced randomly. Default NA. case_type Whether case change based \"word\" \"letter\".","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Messy — messy","text":"dataframe size input data.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Messy — messy","text":"","code":"messy(mtcars) #> mpg cyl disp hp drat wt qsec vs am gear #> Mazda RX4 6 160 110 3.9 2.62 16.46 0 1 4 #> Mazda RX4 Wag 21 6 160 110 3.9 2.875 17.02 0 1 4 #> Datsun 710 22.8 4 108 93 3.85 2.32 18.61 1 1 4 #> Hornet 4 Drive 21.4 6 258 110 3.08 3.215 19.44 1 0 3 #> Hornet Sportabout 18.7 8 360 175 3.15 3.44 0 0 3 #> Valiant 18.1 6 225 105 2.76 3.46 20.22 1 0 #> Duster 360 8 360 245 3.21 3.57 15.84 0 3 #> Merc 240D 24.4 4 146.7 62 3.69 3.19 20 1 0 4 #> Merc 230 22.8 4 140.8 95 3.92 3.15 22.9 1 0 4 #> Merc 280 19.2 6 167.6 123 3.92 3.44 18.3 1 0 #> Merc 280C 17.8 6 167.6 3.92 3.44 18.9 1 0 4 #> Merc 450SE 8 275.8 180 3.07 17.4 0 3 #> Merc 450SL 17.3 8 275.8 3.07 3.73 17.6 0 0 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.78 18 0 3 #> Cadillac Fleetwood 10.4 8 472 205 2.93 5.25 0 #> Lincoln Continental 8 460 215 3 5.424 17.82 0 3 #> Chrysler Imperial 14.7 8 230 3.23 5.345 17.42 0 3 #> Fiat 128 32.4 4 78.7 4.08 2.2 19.47 1 4 #> Honda Civic 30.4 52 4.93 1.615 18.52 1 4 #> Toyota Corolla 33.9 4 65 4.22 1.835 19.9 1 1 4 #> Toyota Corona 21.5 4 120.1 97 3.7 2.465 20.01 1 3 #> Dodge Challenger 15.5 8 318 2.76 3.52 16.87 0 0 3 #> AMC Javelin 8 304 150 3.15 3.435 17.3 0 0 #> Camaro Z28 13.3 8 350 245 3.73 3.84 15.41 0 0 3 #> Pontiac Firebird 19.2 8 400 175 3.08 3.845 17.05 0 0 3 #> Fiat X1-9 27.3 4 79 66 4.08 1.935 18.9 1 1 4 #> Porsche 914-2 26 4 4.43 2.14 0 1 5 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.9 1 1 5 #> Ford Pantera L 15.8 8 351 264 4.22 3.17 14.5 0 1 #> Ferrari Dino 6 145 175 2.77 0 1 5 #> Maserati Bora 15 8 301 3.54 3.57 14.6 0 1 5 #> Volvo 142E 21.4 4 121 109 4.11 2.78 18.6 1 1 4 #> carb #> Mazda RX4 4 #> Mazda RX4 Wag 4 #> Datsun 710 1 #> Hornet 4 Drive 1 #> Hornet Sportabout 2 #> Valiant 1 #> Duster 360 4 #> Merc 240D 2 #> Merc 230 2 #> Merc 280 4 #> Merc 280C 4 #> Merc 450SE 3 #> Merc 450SL 3 #> Merc 450SLC 3 #> Cadillac Fleetwood 4 #> Lincoln Continental 4 #> Chrysler Imperial #> Fiat 128 1 #> Honda Civic #> Toyota Corolla 1 #> Toyota Corona 1 #> Dodge Challenger #> AMC Javelin 2 #> Camaro Z28 4 #> Pontiac Firebird 2 #> Fiat X1-9 1 #> Porsche 914-2 2 #> Lotus Europa 2 #> Ford Pantera L 4 #> Ferrari Dino 6 #> Maserati Bora #> Volvo 142E 2"},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":null,"dir":"Reference","previous_headings":"","what":"Make column names messy — messy_colnames","title":"Make column names messy — messy_colnames","text":"Adds special characters randomly capitalises characters column names data frame.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Make column names messy — messy_colnames","text":"","code":"messy_colnames(data, messiness = 0.2)"},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Make column names messy — messy_colnames","text":"data data.frame alter column names messiness Percentage values change per function. Must 0 1. Default 0.1.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Make column names messy — messy_colnames","text":"data.frame messy column names","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Make column names messy — messy_colnames","text":"Athanasia Monika Mowinckel","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_colnames.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Make column names messy — messy_colnames","text":"","code":"messy_colnames(mtcars) #> mpg cyl -disp hp drat w.t QSEC vs am GEAR $c.arb #> Mazda RX4 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 #> Mazda RX4 Wag 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 #> Datsun 710 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 #> Hornet 4 Drive 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 #> Hornet Sportabout 18.7 8 360.0 175 3.15 3.440 17.02 0 0 3 2 #> Valiant 18.1 6 225.0 105 2.76 3.460 20.22 1 0 3 1 #> Duster 360 14.3 8 360.0 245 3.21 3.570 15.84 0 0 3 4 #> Merc 240D 24.4 4 146.7 62 3.69 3.190 20.00 1 0 4 2 #> Merc 230 22.8 4 140.8 95 3.92 3.150 22.90 1 0 4 2 #> Merc 280 19.2 6 167.6 123 3.92 3.440 18.30 1 0 4 4 #> Merc 280C 17.8 6 167.6 123 3.92 3.440 18.90 1 0 4 4 #> Merc 450SE 16.4 8 275.8 180 3.07 4.070 17.40 0 0 3 3 #> Merc 450SL 17.3 8 275.8 180 3.07 3.730 17.60 0 0 3 3 #> Merc 450SLC 15.2 8 275.8 180 3.07 3.780 18.00 0 0 3 3 #> Cadillac Fleetwood 10.4 8 472.0 205 2.93 5.250 17.98 0 0 3 4 #> Lincoln Continental 10.4 8 460.0 215 3.00 5.424 17.82 0 0 3 4 #> Chrysler Imperial 14.7 8 440.0 230 3.23 5.345 17.42 0 0 3 4 #> Fiat 128 32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1 #> Honda Civic 30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2 #> Toyota Corolla 33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1 #> Toyota Corona 21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1 #> Dodge Challenger 15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2 #> AMC Javelin 15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2 #> Camaro Z28 13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4 #> Pontiac Firebird 19.2 8 400.0 175 3.08 3.845 17.05 0 0 3 2 #> Fiat X1-9 27.3 4 79.0 66 4.08 1.935 18.90 1 1 4 1 #> Porsche 914-2 26.0 4 120.3 91 4.43 2.140 16.70 0 1 5 2 #> Lotus Europa 30.4 4 95.1 113 3.77 1.513 16.90 1 1 5 2 #> Ford Pantera L 15.8 8 351.0 264 4.22 3.170 14.50 0 1 5 4 #> Ferrari Dino 19.7 6 145.0 175 3.62 2.770 15.50 0 1 5 6 #> Maserati Bora 15.0 8 301.0 335 3.54 3.570 14.60 0 1 5 8 #> Volvo 142E 21.4 4 121.0 109 4.11 2.780 18.60 1 1 4 2"},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":null,"dir":"Reference","previous_headings":"","what":"Change the timezone of datetime columns — messy_datetime_tzones","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"Takes number datetime columns changes timezones either totally random, user-provided list timezones.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"","code":"messy_datetime_tzones(data, cols = NULL, tzones = OlsonNames(), force = FALSE)"},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"data input dataframe cols set columns apply transformation . NULL apply POSIXt columns. tzones Valid time zones sample . default samples OlsonNames(), can set options relevant data. force default (force = FALSE) datetimes actual hour/minute values changed along timezones. force = TRUE, requires lubridate, datetime values remain timezone differ.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"dataframe size input data.","code":""},{"path":[]},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"Jack Davison","code":""},{"path":"https://nrennie.rbind.io/messy/reference/messy_datetime_tzones.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Change the timezone of datetime columns — messy_datetime_tzones","text":"","code":"data <- data.frame(dates = rep(Sys.time(), 10)) data$dates #> [1] \"2024-12-03 23:03:51 UTC\" \"2024-12-03 23:03:51 UTC\" #> [3] \"2024-12-03 23:03:51 UTC\" \"2024-12-03 23:03:51 UTC\" #> [5] \"2024-12-03 23:03:51 UTC\" \"2024-12-03 23:03:51 UTC\" #> [7] \"2024-12-03 23:03:51 UTC\" \"2024-12-03 23:03:51 UTC\" #> [9] \"2024-12-03 23:03:51 UTC\" \"2024-12-03 23:03:51 UTC\" attr(data$dates, \"tzone\") #> NULL messy <- messy_datetime_tzones(data, tzones = \"Poland\") messy$dates #> [1] \"2024-12-04 00:03:51 CET\" \"2024-12-04 00:03:51 CET\" #> [3] \"2024-12-04 00:03:51 CET\" \"2024-12-04 00:03:51 CET\" #> [5] \"2024-12-04 00:03:51 CET\" \"2024-12-04 00:03:51 CET\" #> [7] \"2024-12-04 00:03:51 CET\" \"2024-12-04 00:03:51 CET\" #> [9] \"2024-12-04 00:03:51 CET\" \"2024-12-04 00:03:51 CET\" attr(messy$dates, \"tzone\") #> [1] \"Poland\""},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":null,"dir":"Reference","previous_headings":"","what":"Splits date(time) column(s) into multiple columns — split_datetimes","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"functions can split \"date\" \"time\" components POSIXt columns \"hour\", \"month\", \"day\" components Date columns multiple columns.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"","code":"split_datetimes(data, cols = NULL, class = c(\"character\", \"date\")) split_dates(data, cols = NULL)"},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"data input dataframe cols set columns apply transformation . NULL apply POSIXt columns (split_datetimes()) Date columns (split_dates()). class split_datetimes(). desired output separate \"date\" \"time\" columns. \"character\" leaves columns character vectors. \"date\" reformat date \"Date\" time \"POSIXct\" object, dummy date appended . split_dates(), returned columns integers.","code":""},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"dataframe","code":""},{"path":[]},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"Jack Davison","code":""},{"path":"https://nrennie.rbind.io/messy/reference/split-dates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Splits date(time) column(s) into multiple columns — split_datetimes","text":"","code":"# split datetimes data <- data.frame(today = Sys.time()) split_datetimes(data) #> today_date today_time #> 1 2024/12/03 23:03:52 # split dates data <- data.frame(today = Sys.Date()) data #> today #> 1 2024-12-03 split_dates(data) #> today_year today_month today_day #> 1 2024 12 3"},{"path":[]},{"path":"https://nrennie.rbind.io/messy/news/index.html","id":"messy-010","dir":"Changelog","previous_headings":"","what":"messy 0.1.0","title":"messy 0.1.0","text":"CRAN release: 2024-12-03 CRAN release Add duplicate_rows() function messy_datetime_tzones() randomly set different timezones datetime columns messy_datetime_formats() messy_date_formats() format date(times) characters, scramble strptime formats. split_datetimes() split_dates() split datetime columns “date” “time” columns, Date columns “year”, “month”, “day” columns.","code":""},{"path":"https://nrennie.rbind.io/messy/news/index.html","id":"messy-002","dir":"Changelog","previous_headings":"","what":"messy 0.0.2","title":"messy 0.0.2","text":"Add pkgdown site Add lintr file Add messy_colnames() function Add messy_strings() function","code":""},{"path":"https://nrennie.rbind.io/messy/news/index.html","id":"messy-001","dir":"Changelog","previous_headings":"","what":"messy 0.0.1","title":"messy 0.0.1","text":"Add add_whitespaces() function Add make_missing() function Add change_case() function Add initial messy() function Package initialisation","code":""}]