What code in R will do the following:
Given a list 1, 2, …, M create a list of N random entries from that list. Furthermore, obtain the complement list.
example:
N = 5
M = 10
list = [1,4,3,9,2]
complement = [5,6,7,8,10]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
?sampleor as per Joran’s comment:
Also, as a rule, avoid using things like
listas variable names since they are internal R functions.