Re: [R] R Code Execution taking forever

2022-04-24 Thread Rui Barradas
Hello, I'm having trouble running the code, where does function dice come from? CRAN package dice only has two functions, getEventProb getSumProbs not a function dice. Can you post a link to where the package/function can be found? Rui Barradas Às 02:00 de 24/04/2022, Paul Bernal escreveu:

Re: [R] R Code Execution taking forever

2022-04-24 Thread Rui Barradas
Hello, Thanks for the link, the package is TeachingDemos, it's the function that's named dice. And the source code shows that it calls sample() in a way similar to mine, so the code I posted should give approximately the same results. To run just once, change to K <- 1L, right before the mai

Re: [R] R Code Execution taking forever

2022-04-24 Thread Ebert,Timothy Aaron
1) Does it run perfectly with num_tirals_6 <- 100 ? 2) Rework the code to remove as much as possible from loops. Renaming column names each time through the loop seems pointless. Is the nested for loops converting the dice roll to person name necessary within the while loo

Re: [R] R Code Execution taking forever

2022-04-24 Thread Paul Bernal
Dear friend Ebert, The only reason why I labeled the numbers is because out instructor asked for it(as part of the project). However, I agree with you 100% in that labeling is pointless and doesn’t add any value. >From the modified code shared by Rui, it seems to me that the dice function is rath

[R] Issues when setting k to 1L

2022-04-24 Thread Paul Bernal
Dear Rui, I made the modification to k <- 1L (see the code below), but I get the following odd result (maybe I am forgetting to do something): print(final_frame_6) p1 NA NA NA NA NA NA NA NA NA average_prob_frame_6 1 0.437738 NA NA NA NA NA NA NA NA NA NA > print(paste("T