cor( x = parenthood$dan.sleep, y = parenthood$dan.grump )
I couldn't believe that it could do something so complex with such a short command. Its starting to look like the opportunities in R really are as limitless as the book makes it seem!
cor( x = parenthood$dan.sleep, y = parenthood$dan.grump )
I couldn't believe that it could do something so complex with such a short command. Its starting to look like the opportunities in R really are as limitless as the book makes it seem!
> describeBy( x=clin.trial, group=clin.trial$therapy )
I struggled a bit here. I'm wondering if I did the homework right or not because I got it to show the descriptive statistics for average annual wages by industry title but I still got all of the other categories in the middle. It looks like thats how it works here too though.
Unlike thesummary()function, it calculates the samedescriptive statistics for any type of variable you give it.
This is so nice!!! I love the way the book is set up it made jumping around and practicing these much easier.
> kurtosi( x = afl.margins )
I got stuck here for a while in the homework because of there not being an s at the end of kurtosis. Is there a reason for that being that way in R?
positively skewed data set (skewness“.93)
Looks like the skew from the homework data set is positively skewed
Mode
Mode = Most Often ...always confuse this with other things but when I asked someone how they remember they said 'mode = most often' and that helped it click
my.formula <- blah ~ blah.blah # create a variable of class "formula"> print( my.formula )
The formula stuff and combined with the print function is still a bit confusing even after reading this a few times. I'll have to practice it more. I think it would be more helpful if I had an I/O psych example for a reason to use it. Scenarios always help me figure things like this out better.
$nerd[1] TRUE$parents[1] "Joe" "Liz"As you might have guessed from those$symbols everywhere, the variables are stored in exactly the sameway that they are for a data frame (again, this is not surprising: data framesarea type of list). So youwill (I hope) be entirely unsurprised and probably quite bored when I tell you that you can extract thevariables from the list using the$operator, like so:> Dan$nerd
It's a relief to see that even though there is a lot to learn, many things seem to work in the same way, like extracting different data/answers with different methods but using the same symbol $
The simplest way is to use the$operator to extract the variable you’reinterested in, like this
Using the $ symbol makes a lot of sense for me because I used to create quests for players in a game and the $ key was what you had to use to move objects around and trigger events to happen. This will be easy to remember!
expt
Update, I read over this again, compared it to the homework and realized I just misunderstood the directions. I understand how to name things now
in a data frame calledexpt
This part was confusing because I felt like I needed to rename mine in the homework but I can't find in here where it told us how to rename it. How can we rename a data frame like that?
s you can see,rm()can be very handy for keeping theworkspace tidy
I'm a little confused by this. Didn't it say earlier that when we open it, nothing is left over? Do we have to clear everything before leaving to avoid future issues?
Rpackages are out there on the internet, waiting foryou to download, install and use them
Do these work like the toolkits you can download for excel? Do we have a list of safe websites to download from?
Extracting multiple elements
This section was a bit confusing so I got help from my dad who does a lot of programming work.
> 10 - 20[1] -10
I can easily see myself getting tripped up by putting things in the wrong order. If I make mistakes like this on assignments, how many points would be deducted? I'll definitely try to avoid this issue.
nstalling R on a Mac
I have R installed from about two years ago when I was going to try and learn it for fun. Will I need to look for an updated version? Will that make a big difference?