Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 56 commits into
base: feedback
Choose a base branch
from
Open

Feedback #1

wants to merge 56 commits into from

Conversation

github-classroom[bot]
Copy link

@github-classroom github-classroom bot commented Sep 5, 2023

👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.
In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.
Click the Files changed or Commits tab to see all of the changes pushed to main since the assignment started. Your teacher can see this too.

Notes for teachers

Use this PR to leave feedback. Here are some tips:

  • Click the Files changed tab to see all of the changes pushed to main since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.
  • Click the Commits tab to see the commits pushed to main. Click a commit to see specific changes.
  • If you turned on autograding, then click the Checks tab to see the results.
  • This page is an overview. It shows commits, line comments, and general comments. You can leave a general comment below.
    For more information about this pull request, read “Leaving assignment feedback in GitHub”.

Subscribed: @SyafiqahIsa @BazilahHM19 @Hilalina13 @Fiqah-Alihan

Copy link
Member

@haziqj haziqj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, be aware of the file names you are supposed to use. There are multiple files expected for this assignment. The first one should be 01-gen_collatz.R (not solution.R).

@haziqj
Copy link
Member

haziqj commented Sep 23, 2023

Congratulations on passing autograder! 🎉

@BazilahHM19 BazilahHM19 temporarily deployed to github-pages September 26, 2023 03:06 — with GitHub Pages Inactive
Added contibution declaration
@SyafiqahIsa SyafiqahIsa temporarily deployed to github-pages September 26, 2023 03:20 — with GitHub Pages Inactive
@Hilalina13 Hilalina13 temporarily deployed to github-pages September 26, 2023 03:24 — with GitHub Pages Inactive
Edited the png files
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very informative code. Good job!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Straight forward code to read and follow.

@nichongy
Copy link

Not a fan of the many notes in 5-open.R, should be in the README instead. Otherwise, well done.

Copy link

@Ros-2646 Ros-2646 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you all were very creative and for each task it is very informative. But perhaps next time when updating the codes add descriptions. I didn't quite know that there's easier way to do the codes especially for task 1 and 2 but as of the other I think you can make it shorter.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really love how everything is fully explained here, but I think the actual code overwhelmed by the comments/notes/explanation.

slice_head(n = 10) %>%
select(start)

top10longest <- as_tibble(t(top10longest))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooo transposing the matrix seems like a good idea! I was wondering how you managed to create different colours for each points but I understand now!

Comment on lines +16 to +18
if (value == 1) {
break
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thing, but this may not be necessary, because the last term in a sequence will be 1 anyways!

@mimihassan
Copy link

Regarding the commit messages, it will be very helpful to write more information or details on what you have committed so it is easier for you to track the changes made

Comment on lines +31 to +33
max_count <- function(seq, start) {
sum(seq > start)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't actually how you should count the number of backtracking in a sequence! Remember that you have to wait until a term goes below the starting number first, then count from there! This is counting immediately from the start!


max_after_backtrack <- t(max_after_backtrack)

max_after_backtrack
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think printing this is a good idea 😅

Copy link

@fizahjamal fizahjamal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's all great work! i really like how detailed it 😀 the only thing i'd like to comment is that explanations on the task5 r file should have been put into the readme instead, and also it would be alright to just show the outputs only on your readme file and link the rcode files. Overall, this is great work!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow! i didn't think of computing this! it's unique! but maybe the explanations would be more suitable on the readme repo instead of in this r file since essentially r file focuses mainly on writing rcodes only.

y = length)
) +
geom_point() +
geom_point(data = head(backtracks_df, 10),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what went wrong here! You forgot to arrange the backtracks_df by descending order of length first before using head()! So it ended up simply highlighting the first 10 rows of backtracks_df instead

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing happened to the other highlighted points here! You may want to validate that your plot comes out as you expected!

Comment on lines +38 to +41
scale_x_continuous(
limits = c(0, 2000)) +
scale_y_continuous(
limits = c(0,100))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting! Yes, it is a good idea to zoom in to important points once you have shown the full plot before!

Comment on lines +44 to +60
# 2) Creating a scatterplot of the highest value reached in the sequence

max_after_backtrack_df <- backtracks_df %>%
mutate(max_val_reached = pmap_dbl(list(seq, start), max_val_reached))

ggplot(data = max_after_backtrack_df,
aes(x = start,
y = max_val_reached)) +
geom_point() +
geom_point(data = head(max_after_backtrack_df, 10),
aes(colour = factor(start)),
size = 5) +
labs(
title = "The Highest Value Reached in the Sequence",
x = "Starting Integer",
y = "Maximum Value Reached",
colour = "Top 10 Starting Integer")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be a good idea to use logarithmic scale for the y-axis in here, as the rest of the points are very squished together that it's difficult to see what patterns the other points might have made!

Try adding + scale_y_log10() to the bottom of this code!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty insightful! The explanation seems to better fit for the README though! Comments are good, but too many of them makes it difficult to look at the code as a whole!

Copy link

@hani-hive hani-hive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, there are some changes that need to be corrected, but nice work everyone, and love the construction of your README.md.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give more information about legend and correct the plot since you've stated more than 1 colour in the legend differ from the dotted plot of black-pink.

y = "Sequence Length",
color = "Parity") +

theme_minimal()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Plot! That is another nice way of using different types of plots, that is using geom_line() to see the changes of the sequence lengths over a range of starting integers, instead of using geom_point().

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool plot! I really appreciate how easy it is to see how even starting integer compares to odd starting integers in terms of sequence length!

@WaqiMTC
Copy link

WaqiMTC commented Sep 26, 2023

Hello, well done on this repo! Here are some general issues I need to point out:

  • There seems to be a lack of descriptions in the commits! Please write something in your description so people can understand what has changed more quickly!
  • Footnotes are done by writing [^1]
  • There is a lack of comments inside the files! Do comment in order to let viewers of the code understand them more easily and go through the code quicker! Due to the lack of comments in most of the files, it did take a while to look through the code, hence the late submission from me 😅
  • It seems to me that quite a bit of the code doesn't really follow the tidyverse style guide! Admittedly, checking the tidyverse guide again and again while coding may be a bit inconvenient, so I suggest making use of the styler and lintr packages to make the style check easier!

And then personal comments:

  • It was really clever to use the t() function to transpose data so that each value is put into different variables, which seems like a convenient method of making the points in the plot different colours! I'm definitely stealing that idea in my future R projects, but I do suggest hiding the legend if using this method, especially if you want to highlight a large number of points!
  • I noticed that you included outputs inside the README, which is very nice! If you intend to do more like that, I do suggest using Rmd file format, as you can actually run code and then print the output inside the README! Of course, this seems to only work if you save and knit it in RStudio though!

Once again, great job!

Copy link

@mimihassan mimihassan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looking at your team's simple code made me realise how much I overthink on how to code HAHA i learn a lot from your coding style, well done!

readme__1.md Outdated
Comment on lines 161 to 172
max_count <- function(seq, start) {
sum(seq > start)
}

count_df <- backtracks_df %>%
mutate(count=pmap_int(list(seq,start),max_count))

mode_backtrack <- count_df %>%
group_by(count) %>%
summarise(seq_count = n()) %>%
filter(seq_count == max(seq_count)) %>%
pull(count)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh! so that's how you do it... got me all stressing for just missing one function to pass the autograde :') great work and neat coding!

Comment on lines +28 to +32
even_odd_avg_len <- collatz_df %>%
group_by(parity) %>%
summarise(avg = mean(length)) %>%
arrange(avg) %>%
select(avg)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooooh! your code is simple and easy to understand! that's so cool how you figure out the code and pass the autograde that fast! well done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.