pearselab / r-world-jenessalemon

r-world-jenessalemon created by GitHub Classroom
0 stars 0 forks source link

Just working on terrain still! #5

Open jenessalemon opened 7 years ago

jenessalemon commented 7 years ago

@willpearse Can you take a look at my code for terrain.R on lines 114 and below? Paul had a great idea to try to predetermine how many times the width of the matrix is going to have to be cut in half. My sad attempt to do so starts on line 128. Once I can get this vector of half values determined, can I use it to calculate "top" and "mid" (defined just under the for loop on lines 115 and 116) and go through the matrix that way? When we talked yesterday it felt like I was so close...I was not very close...

willpearse commented 7 years ago

You were very close. Paul's method is totally fine to do it, but it's not the way I was guiding you. I sense you've asked him for something because you got confused over what you already had.

seq is giving you those mid-points. Look at the output you've written in on line 101. Remember what we discussed during the session: you want to loop over something to get the different midpoints, and then loop again across columns and then loop across rows to calculate all the subsets.

jenessalemon commented 7 years ago

@willpearse I tried writing the first loop on line 79. At the beginning you told us we could call on you to write us a little piece of code, if I can use it now I would like to!

jenessalemon commented 7 years ago

Just discovered for (i in 2^(n:1)) ... give me a chance!

willpearse commented 7 years ago

I'm not sure what you mean by this...