Watts-College / paf-513-fall-2023

0 stars 0 forks source link

Lab #3 #10

Open jasminacosta opened 1 year ago

jasminacosta commented 1 year ago

Hi Professor,

On lab #3 I am having a hard time trying to get the specifics down with the written information below the title "Strikeouts on the Rise". I saw in the help(mtext) that I could make a legend and that seemed to help to get it under my title since I struggled to do that. However, the spacing is off and it is not all the way on the left side of the canvas. There are a lot of minor details especially on that part of my graph and I am not sure how to fix that.

Also, one more question how would I fix my two point labels that say "1924" and "2012" so that way it is centered properly within the text?

Thank you!

Screenshot 2023-09-05 at 6 15 49 PM

drcarlson-asu commented 1 year ago

Hi Jasmin, All of this can be modified in the full replication code. I encourage you to experiment with the differing variables (increasing, decreasing amounts, etc.) to see how they impact the graph's aesthetic. I will not deduct any points for minor formating issues. ~Dr. C

jasminacosta commented 1 year ago

Hi Professor,

I will surely try that and see how it goes! I appreciate the feedback.

For this lab how are we being graded? Is it based on having everything there as similar as we can get it?

drcarlson-asu commented 1 year ago

I'll be grading based on whether you are getting the overall gist of this material. The closer to the graph you can get, the better.

jasminacosta commented 1 year ago

That makes sense.

Thank you for the clarification!

Jcarbo7850 commented 1 year ago

Good day Jasmin - I have to know!! Where are you getting the material to complete this assignment? Just one great example: one of the reading assignments has ablines() as a key concept, but it never mentions it again. You would think key concepts would be explained. This is just one of several examples. Any insight you can provide would be greatly appreciated.

jasminacosta commented 1 year ago

Hi!

To complete the material it has been a journey to be quite frank.

It has been a lot of googling, YouTube videos, and using the help(mtext) aspect in R.

The greatest help for me has been using the help(mtext) aspect to look up different functions.

When you run the help(mtext) and on the right side in the search bar type in "abline" and a bunch of different material should pop up. It is a lot of trial and error but it does provide a quick definition to what each function means and how to use it. Also, some functions may not be there but it is a lot of looking up different functions to be able find the ones that help.

Within the notes there are a lot functions to help with the abline such col="color name" so that is a great way to get the color of the lines.

https://www.nceas.ucsb.edu/sites/default/files/2020-04/colorPaletteCheatsheet.pdf ^ this right here is a source I used for my colors in case this is any help

To get the line type you want you can use lty= ____ from there you can put in different numbers to see how it changes the line type.

For example, lty= 1 gives a solid regular line.

http://www.sthda.com/english/wiki/line-types-in-r-lty

^ good resource for line types in the ones you might need

My biggest hurdle although was how to get the abline to go horizontally with the sequence of the y axis on the right side of the graph and for this you can use the function h=

However, with this you would have to use some of the code from the axis that makes the sequence 1-9.

To demonstrate it would be:

abline(h=seq(the sequence of the axis numbers, 1), col="color name", lty= line type which is indicated by a number)

To clarify to making sure I make sense and there is no confusion the sequence of the axis numbers are the 1-9

This line of code that is given to us:

axis(side = 4, # Add y-axis lwd = 0, # Remove axis line las = 1, # Rotate labels col.axis = "gray85", # Adjust label colors at = seq(from = 0, # Specify axis values to = 9, by = 1), font.axis = 2) # Set labels to bold

Specifically this part:

at = seq(from = 0,
to = 9, by = 1),

NOTE: Remember in earlier notes to get a sequence of numbers we would use 1:10 to get the numbers 1-10. HOWEVER, when using the function seq( ) we need to use a comma between the sequence of numbers we want

example: seq(1, 20) gives numbers 1-20

https://www.simonqueenborough.info/R/basic/lessons/Sequences_of_Numbers.html#:~:text=The%20simplest%20way%20to%20create,to%20see%20how%20it%20works.&text=That%20gave%20us%20every%20integer,counting%20number%2C%20including%200).

^ This website should help with that distinction in case it is hard to visualize.

I hope this helps!

jasminacosta commented 1 year ago

Good day Jasmin - I have to know!! Where are you getting the material to complete this assignment? Just one great example: one of the reading assignments has ablines() as a key concept, but it never mentions it again. You would think key concepts would be explained. This is just one of several examples. Any insight you can provide would be greatly appreciated.

Hi, I am not sure if by quoting your question this will help to let you know I provided some insight to your question.

Hopefully this reaches to you!