I need help to these questions ### Question 1 Create a variable containing a sequence of numbers from 1 to 100: Iterate over the variables and print those numbers which are prime. ### Question 2 Create a matrix of size 3x3 called mat_1: Iterate over all the values one by one and print the element as well as the position in the matrix (row, col) [[alternative HTML version deleted]]
This looks suspiciously like homework and this list does have a no homework policy. If it is not homework, please forgive the assumption.> On Oct 26, 2021, at 4:09 PM, Anas Jamshed <anasjamshed1994 at gmail.com> wrote: > > I need help to these questions > > ### Question 1 > Create a variable containing a sequence of numbers from 1 to 100: > > Iterate over the variables and print those numbers which are prime. > > > ### Question 2 > Create a matrix of size 3x3 called mat_1: > > Iterate over all the values one by one and print the element as well as > the position in the matrix (row, col) > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Knowledge Institute of St. Michael?s Hospital Assistant Professor, Dalla Lana School of Public Health University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.One of the items mentioned in the Posting Guide is that homework questions are not okay... we don't know what your instructor is looking for, and they are expected to provide support for their instruction plan. On October 26, 2021 1:09:50 PM PDT, Anas Jamshed <anasjamshed1994 at gmail.com> wrote:>I need help to these questions > >### Question 1 >Create a variable containing a sequence of numbers from 1 to 100: > >Iterate over the variables and print those numbers which are prime. > > >### Question 2 >Create a matrix of size 3x3 called mat_1: > > Iterate over all the values one by one and print the element as well as >the position in the matrix (row, col) > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.-- Sent from my phone. Please excuse my brevity.
On Wed, 27 Oct 2021 01:09:50 +0500 Anas Jamshed <anasjamshed1994 at gmail.com> wrote:> I need help to these questions > > ### Question 1 > Create a variable containing a sequence of numbers from 1 to 100: > > Iterate over the variables and print those numbers which are prime. > > > ### Question 2 > Create a matrix of size 3x3 called mat_1: > > Iterate over all the values one by one and print the element as well > as the position in the matrix (row, col)You really should do your own homework. cheers, Rolf Turner -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276