How to save every answers in matrix with 2 for loops.

Hi,

Welcome to the RStudio community!

First of all, I'd like to inform you that if your questions are school or homework related, you should always clearly state so and read your guidelines on the topic:

Second, when asking a question here, it's best you create a reprex, where you generate the minimal code and data needed to recreate the issue you're having. You can find instructions how to build and share one here:

Kind regards,
PJ