Try to search your question here, if you can't find : Ask Any Question Now ?

R element by element compute, by group

HomeCategory: stackoverflowR element by element compute, by group
Avatarjulie asked 1 month ago

I’m attempting to do a computation by Id group. would like to use dplyr, but not necessary. In the history column,i have a string of numbers (all same length, 36). I want to apply the rule, get the largest (max) value, element by element, and get out a new single history, for each Id.
For example, for ID = 1157, the new, single string, would be
432100000000000000000000000000000000, as those are the largest values for each element, for that ID. I would like to do this for all Ids (thousands of them).

     Id                              history
1  1157 101000000000000000000000000000000000
2  1157 000000000000000000000000000000000000
3  1157 432100000000000000000000000000000000
4  1157 321000000000000000000000000000000000
5  1157 000000000000000000000000000000000000
6  1157 432100000000000000000000000000000000
7  1157 211000000000000000000000000000000000
26 1351 000000000000000000000000000000000000
27 1351 000000000000000000000000000000000000
45 1351 000000000000000000000000000000000000
46 1351 000000000000000000000000000000000000
47 1351 000000000000000000000000000000000000
48 1351 000000000000000000000000000000000000
49 1351 000000000000000000000000000000000000
50 1351 000000000000000000000000000000000000
51 1351 000000000000000000000000000000000000
52 1351 000000000000000000000000000000000000
53 1351 000000000000000000000000000000000000
54 1351 000000000000000000000000000000000000
55 1351 000000000000000000000000000000000000
1 Answers
Best Answer
AvatarJyoti answered 1 month ago
Your Answer

19 + 7 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com