Question: How to fill matrix in R using row and column names as arguments without for loops ? For example, there is a matrix rownames(M)

How to fill matrix in R using row and column names as arguments without for loops ?

For example, there is a matrix

rownames(M) <- seq(10, 10.5, by = 0.1) colnames(M) <- seq(40, 43, by = 0.5)

 40 40.5 41 41.5 42 42.5 43 10 NA NA NA NA NA NA NA 10.1 NA x NA NA NA NA NA 10.2 NA NA NA NA NA NA NA 10.3 NA NA NA NA NA NA NA 10.4 NA NA NA NA NA NA NA 10.5 NA NA NA NA NA NA NA
which we need to fill with the results of calling function F with row and column names as arguments, like x = F(10.1, 40.5). 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!