R Programming I need to this Loop through columns (i) Identify values in minimal_2dr[[i]] that are less than -0.1 [using logical indexing] Select only those values (e.g. 2 values) Select corresponding values of minimal_indices[[i]] (corresponding 2 values) How would i do this?
R
I need to this
Loop through columns (i)
Identify values in minimal_2dr[[i]] that are less than -0.1 [using logical indexing]
Select only those values (e.g. 2 values)
Select corresponding values of minimal_indices[[i]] (corresponding 2 values)
How would i do this?
Algorithm that describes the steps in the code:
1. Initialize minimal_2dr and minimal_indices data structures with appropriate data
2. Loop through each column of minimal_2dr using a for loop:
a. Identify the values in the current column that are less than -0.1 using logical indexing
b. Select only those values using the identified indices from step a
c. Select corresponding values of minimal_indices for the selected values from step b
d. Print the selected values and corresponding indices for the current column using cat() function.
Step by step
Solved in 3 steps with 1 images