Merge Conflicts (uh oh)

Today's lab consists of two parts. First, you and your team will resolve a merge conflict. Read the following steps carefully, and follow the steps in order. Part of your grade will be whether you have successfully resolvde the merge conflict. Afterwards, you will complete a lab assignment as usual.

You may have seen this already through the course of your collaboration last week. When two collaborators make changes to a file and push the file to their repository, git merges these two files.

If these two files have conflicting content on the same line, git will produce a merge conflict. Merge conflicts need to be resolved manually, as they require a human intervention:

To resolve the merge conflict, decide if you want to keep only your text, the text on GitHub, or incorporate changes from both texts. Delete the conflict markers <<<<<<<, =======, >>>>>>> and make the changes you want in the final merge.

Assign numbers 1, 2, 3, and 4 to each of your team members (if only 3 team members, just number 1 through 3). Go through the following steps in detail, which simulate a merge conflict. Completing this exercise will be part of the lab grade.

Resolving a merge conflict

Step 1: Everyone a repository has been created for you in the course repository. Open the file merge-conflict.qmd. Don’t forget to configure git if you haven’t already done so.

Member 4 should look at the group’s repo on GitHub.com to ensure that the other members’ files are pushed to GitHub after every step.

Step 2: Member 1 Change the team name to your team name. Knit, commit, and push.

Step 3: Member 2 Change the team name to something different (i.e., not your team name). Knit, commit, and push.

You should get an error.

Pull and review the document with the merge conflict. Read the error to your teammates. You can also show them the error by sharing your screen. A merge conflict occurred because you edited the same part of the document as Member 1. Resolve the conflict with whichever name you want to keep, then knit, commit and push again.

Step 4: Member 3 Write some narrative in the space provided. You should get an error.

However, this time no merge conflicts should occur since you edited a different part of the document from Members 1 and 2. Read the error to your teammates. You can also show them the error by sharing your screen.

Click to pull. Then, knit, commit, and push.

Hertzsprung–Russell diagrams

We will now use the main lab .qmd file found in your repository.

Hertzsprung–Russell diagrams are visualizations that show the relationship between the brightness of stars and their temperatures. Before continuing the lab, read about H-R diagrams here.

The dataset for this assignment can be found as a csv file in the data folder of your repository. This dataset represents data from over six thousand stars as taken from the General Catalogue of Trigonometric Stellar Parallaxes. There are only four variables in the provided dataset:

  • Vmag: Apparently visual band magnitude, a measure of brightness. Don’t worry about the units for the purposes of this lab.
  • Bvcol: The color of the star, which usually corresponds to the temperature of the star (generally, negative values correspond to hot blueish stars; values around 0.5 are white, and values above 1 or so are cooler orange to red stars). Don’t worry about the units for the purposes of this lab.
  • parallax: parallax in arcseconds, a measure of the distance of the star from Earth
  • class: the color index of the star, another measure of the temperature of a star. The stars contained in today's dataset are of the following classes, arranged in order of decreasing temperature (i.e., B class are the hottest in the dataset): B, A, F, G, K, M. (even hotter O class stars exist, but we don't have any today!)

Exercises

  1. Create a linear model that predicts visual band magnitude with B-V color, parallax, and color index. In your linear model, treat stellar class M as the baseline/referent category.
  2. Interpret the parameter estimates corresponding to the intercept and slopes for B-V color, parallax, and class "F" stars in context of your model.
  3. Create a scatterplot that has visual band magnitude on the y-axis and B-V color on the x-axis (no need to use parallax or color index in this scatterplot; there is also no need to provide a title for this exercise, but please provide strong axis labels). Compare this to an actual H-R diagram, for instance as depicted in the brief article referenced above. What is an important variable that is missing from the dataset that might help you best predict visual magnitude using B-V color? Hint: there is a single correct answer here that we’re looking for in particular. It’s not luminosity, which is technically calculable from parallax and apparent visual magnitude).
  4. What percentage of variability in visual band magnitude is explained by its linear relationship with B-V color, parallax, and color index? Does this value mean that your model is good?
  5. Extend your visualization in Ex. 3 to create an more realistic H-R diagram that additionally uses a realistic color scheme for the stars. Some colors and their corresponding B-V values are available here. You may use RGB hex color #ffc66d for the largest B-V value and #9bb0ff for the smallest B-V value. Again, please provide strong axis labels, but no need to title your plot. Don't forget to cite any sources you use in the preparation of this plot!

There should only be one submission per team on Gradescope.