R.mergePath
See original GitHub issueThere is assoc function and there is assocPath, they solve one of the goals properly, but shouldn’t there be a path analogue for merge as well?
A common case, you must travel 4 levels deep into an object and merge objects under same key, it can be done with composition, such as this:
const lens = R.lensPath(['a', 'b']);
R.over(lens, R.merge(R.__, {c2: 22, c3: 33}), {a: {b: {c1: 1, c2: 2}}});
//> {a: {b: {c1:1, c2: 22, c3: 33}}}
But isn’t this a common usage case? So something like R.mergePath([‘a’, ‘b’], {c2: 22, c3: 33}, {a: {b: {c1: 1, c2: 2}}})
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
Function to concatenate paths? - r - Stack Overflow
The function works only with slashes as path separator, which is fine, since R transparently translates them to backslashes on Windows machine.
Read more >A path join function - R-Project.org
This function joins strings into a valid path. It is a simple version of python's os.path.join and fixes simple problems such as having/not...
Read more >merge: Merge Two Data Frames - Rdrr.io
merge is a generic function whose principal method is for data frames: the default method coerces its arguments to data frames and calls...
Read more >How to use the merge() function for data frames in R
The merge() function in R combines two data frames. The most crucial requirement for connecting two data frames is that the column type...
Read more >Merge all files in a directory using R into a single dataframe
Merging the Files into a Single Dataframe ... The final step is to iterate through the list of files in the current working...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Just catching up.
My feeling is that something like
mergePathis the sort of function for which we created the Cookbook. If we see a lot of demand, we could consider moving it into the library.@char0n: I seem to have missed a bunch of messages. Those look fine for the Cookbook.