I have a huge data.frame with 5 variables (v1, v2, v3, v4, v5). I need to create several subsets based on a single variable. For example:
DATA
v1 v2 v3 ...
1 1231 0.1
1 2653 0.3
1 4545 0.4
2 4545 0.6
2 3345 0.1
2 5675 0.7
3 6754 0.2
3 9989 0.85
3 3456 0.4
.
.
.
70000
70000
70000
I would like to create subsets for each value on v1 using a function that easily generates each dataset in an automated way since I have over 70000 measurements for this variable. Then, once I have the datasets, I would like to perform a correlation for v2 and v3 and have an output with the p-values and rho in separate columns. I'm sorry I haven't attempted any command yet, but I having troubles understanding how to generate the function.