I'm new to R.
I have a data frame that each column contains 1 and 0 only.
I need to sample 10,000 times each column in the data frame, and then create new row that contains the probability of choosing 1 (I guess it's mean), and then binding it to the date frame.
I know how to create another row and binding it to the the original data frame.
But how to itearate over columns and sample (including doing mean) seperatly and then modify the new row accordingly? The syntax is little bit tricky for me.