apply

Count specific characters from column associated with dual categories of other column. Do it iteratively based on frequency bins

泪湿孤枕 提交于 2020-06-08 12:37:56
问题 I have a huge dataframe df1, whose oversimplified version consists of 3 columns, "Words", "Frequency" and "Letters": Words Frequency Letters flower/tree 0.15 a(0.1) tree 0.67 a(0.4) planet 0.85 b(0.4) tree/planet 0.42 c(0.5) tree 0.89 a(0.6) flower 0.21 b(0.4) flower/planet 0.53 b planet 0.07 a Using R (dplyr, apply family functions, etc.) I would like to count the number of times every letter (a, b, c) of the "Letter" column is associated with every single word from the "Word" column (flower

Count specific characters from column associated with dual categories of other column. Do it iteratively based on frequency bins

无人久伴 提交于 2020-06-08 12:37:26
问题 I have a huge dataframe df1, whose oversimplified version consists of 3 columns, "Words", "Frequency" and "Letters": Words Frequency Letters flower/tree 0.15 a(0.1) tree 0.67 a(0.4) planet 0.85 b(0.4) tree/planet 0.42 c(0.5) tree 0.89 a(0.6) flower 0.21 b(0.4) flower/planet 0.53 b planet 0.07 a Using R (dplyr, apply family functions, etc.) I would like to count the number of times every letter (a, b, c) of the "Letter" column is associated with every single word from the "Word" column (flower