purrr

Tidy method to split multiple columns using tidyr::separate

浪尽此生 提交于 2020-11-29 02:53:51
问题 I have a data frame like so: df <- structure(list(A = c("3 of 5", "1 of 2", "1 of 3", "1 of 3", "3 of 4", "2 of 7"), B = c("2 of 2", "2 of 4", "0 of 1", "0 of 0", "0 of 0", "0 of 0"), C = c("10 of 21", "3 of 14", "11 of 34", "10 of 35", "16 of 53", "17 of 62"), D = c("0 of 0", "0 of 0", "0 of 0", "0 of 0", "0 of 0", "0 of 0"), E = c("8 of 16", "3 of 15", "10 of 32", "6 of 28", "13 of 49", "9 of 48")), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -6L)) df |A |B |C |D |E | |:----

Tidy method to split multiple columns using tidyr::separate

≯℡__Kan透↙ 提交于 2020-11-29 02:50:37
问题 I have a data frame like so: df <- structure(list(A = c("3 of 5", "1 of 2", "1 of 3", "1 of 3", "3 of 4", "2 of 7"), B = c("2 of 2", "2 of 4", "0 of 1", "0 of 0", "0 of 0", "0 of 0"), C = c("10 of 21", "3 of 14", "11 of 34", "10 of 35", "16 of 53", "17 of 62"), D = c("0 of 0", "0 of 0", "0 of 0", "0 of 0", "0 of 0", "0 of 0"), E = c("8 of 16", "3 of 15", "10 of 32", "6 of 28", "13 of 49", "9 of 48")), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -6L)) df |A |B |C |D |E | |:----

Sum amount last 6 month prior to the date of transaction

一个人想着一个人 提交于 2020-11-24 16:17:34
问题 This is my transaction data. It shows the transactions made from the accounts in from column to the accounts in to column with the date and the amount information data id from to date amount <int> <fctr> <fctr> <date> <dbl> 19521 6644 6934 2005-01-01 700.0 19524 6753 8456 2005-01-01 600.0 19523 9242 9333 2005-01-01 1000.0 … … … … … 1056317 7819 7454 2010-12-31 60.2 1056318 6164 7497 2010-12-31 107.5 1056319 7533 7492 2010-12-31 164.1 I want to calculate how much transaction amount the

Sum amount last 6 month prior to the date of transaction

微笑、不失礼 提交于 2020-11-24 16:10:58
问题 This is my transaction data. It shows the transactions made from the accounts in from column to the accounts in to column with the date and the amount information data id from to date amount <int> <fctr> <fctr> <date> <dbl> 19521 6644 6934 2005-01-01 700.0 19524 6753 8456 2005-01-01 600.0 19523 9242 9333 2005-01-01 1000.0 … … … … … 1056317 7819 7454 2010-12-31 60.2 1056318 6164 7497 2010-12-31 107.5 1056319 7533 7492 2010-12-31 164.1 I want to calculate how much transaction amount the

Sum amount last 6 month prior to the date of transaction

断了今生、忘了曾经 提交于 2020-11-24 16:10:48
问题 This is my transaction data. It shows the transactions made from the accounts in from column to the accounts in to column with the date and the amount information data id from to date amount <int> <fctr> <fctr> <date> <dbl> 19521 6644 6934 2005-01-01 700.0 19524 6753 8456 2005-01-01 600.0 19523 9242 9333 2005-01-01 1000.0 … … … … … 1056317 7819 7454 2010-12-31 60.2 1056318 6164 7497 2010-12-31 107.5 1056319 7533 7492 2010-12-31 164.1 I want to calculate how much transaction amount the

Sum amount last 6 month prior to the date of transaction

 ̄綄美尐妖づ 提交于 2020-11-24 16:10:27
问题 This is my transaction data. It shows the transactions made from the accounts in from column to the accounts in to column with the date and the amount information data id from to date amount <int> <fctr> <fctr> <date> <dbl> 19521 6644 6934 2005-01-01 700.0 19524 6753 8456 2005-01-01 600.0 19523 9242 9333 2005-01-01 1000.0 … … … … … 1056317 7819 7454 2010-12-31 60.2 1056318 6164 7497 2010-12-31 107.5 1056319 7533 7492 2010-12-31 164.1 I want to calculate how much transaction amount the