Re: [R] What don't I understand about sample()?

2025-03-15 Thread avi.e.gross
Richard, After some thinking, I conclude that founders of things, including ancient religious figures as well as people who have developed programming languages, may not recognize what follows later. As an example, you have customs in some religions revolving around trees and snow or around pot

Re: [R] What don't I understand about sample()?

2025-03-15 Thread avi.e.gross
Richard, The function with a period as a separator that you cite, read.csv, is part of normal base R. We have been discussing a different function named just a tad different that uses an underscore as a separator, read_csv that is similar but has some changes in how it works and the options su

Re: [R] What don't I understand about sample()?

2025-03-15 Thread Richard O'Keefe
Rgui 4.4.3 on Windows. When I start it up, read.csv is just *there*. I don't need to load any package to get it. I have three reasons for being very sparing in the packages I use. 1. It took me long enough to get my head around R. More packages = more things to learn. I *still* have major troub

Re: [R] What don't I understand about sample()?

2025-03-15 Thread avi.e.gross
Rui, I just want to discuss this point you made for now: 2. Systematic use of apply(., 1, mean). rowMeans (and colMeans) are much faster. You are, of course, technically correct. I consider an alternative aspect in which you are teaching a programming language as a small

Re: [R] What don't I understand about sample()?

2025-03-15 Thread Rui Barradas
Hello, I have been following this thread and though answers have been given, some of them address R coding in general, not necessarily the sample() function. Here are some random notes I think the OP could use, prompted by the text linked to, chap3.pdf. 1. Throughout the text, assignments us

Re: [R] What don't I understand about sample()?

2025-03-15 Thread Ebert,Timothy Aaron
Brian Manly wrote a nice book about computer intensive methods in data analysis: https://www.amazon.com/Randomization-Bootstrap-Methods-Biology-Statistical/dp/1584885416. Therein there is a distinction between permutation tests and randomization tests. A permutation test uses every permutation

Re: [R] What don't I understand about sample()?

2025-03-15 Thread avi.e.gross
Kevin & Richard, and of course everyone, As the main topic here is not the tidyverse, I will mention the perils of loading in more than needed in general. If you want to use one or a very few functions, it can be more efficient and safe to load exactly what is needed. In the case of wanting to

Re: [R] What don't I understand about sample()?

2025-03-15 Thread Kevin Zembower via R-help
Hi, Richard, thanks for replying. I should have mentioned the third edition, which we're using. The data file didn't change between the second and third editions, and the data on Body Mass Gain was the same as in the first edition, although the first edition data file contained additional variables

[R] [SPAM | WERBUNG] Re: What don't I understand about sample()?

2025-03-15 Thread Kevin Zembower via R-help
Avi, hi, thanks for your reply. I was vaguely aware of the '...' construct, but hadn't ever worked out how to actually use it. Thank you so much for teaching me that. I agree that I should use it in my function. Yeah, I just used the parentheses around some of my assignments to avoid the trouble o

Re: [R] What don't I understand about sample()?

2025-03-15 Thread peter dalgaard
Yes. If you want repeated calls to sample() you need to call it several times. Try, for instance replicate(5, sample(1:10)) which is nearly the structure you expected, except transposed. -pd > On 13 Mar 2025, at 22.33, Bert Gunter wrote: > > Bravo for your unrequired R efforts. > > You misun

Re: [R] What don't I understand about sample()?

2025-03-15 Thread Richard O'Keefe
Not having the book (and which of the three editions are you using?), I downloaded the data and played with it for a bit. dotchart() showed the Dark and Light conditions looked quite different, but also showed that there are not very many cases. After trying t.test, it occurred to me that I did not