<jupyter_start><jupyter_text>ASSIGNMENT CONFIGgenerate: truetemplate_pdf: truesolutions_pdf: truefiles:    - data.csv<jupyter_code>library(testthat)
library(ggplot2)<jupyter_output>Warning message:
“replacing previous import ‘vctrs::data_frame’ by ‘tibble::data_frame’ when loading ‘dplyr’”<jupyter_text>BEGIN QUESTIONname: q1points:    - 1    - 1    - 1    - 2<jupyter_code>**Question 1.** Assign `x` to the smallest prime number.<jupyter_output><empty_output><jupyter_text>BEGIN SOLUTION<jupyter_code>x <- 2 # SOLUTION<jupyter_output><empty_output><jupyter_text>END SOLUTION  BEGIN TESTS<jupyter_code>testthat::expect_true(is.numeric(x))
testthat::expect_true(0 < x)
testthat::expect_true(x < 100)
# HIDDEN
testthat::expect_equal(x, 2)
. = " # BEGIN TEST CONFIG
name: q1d
hidden: true
success_message: congrats
" # END TEST CONFIG
testthat::expect_equal(as.character(x), "2")<jupyter_output><empty_output><jupyter_text>END TESTS  END QUESTION  BEGIN QUESTIONname: q2manual: true<jupyter_code>**Question 2.** Visualize the answer<jupyter_output><empty_output><jupyter_text>BEGIN SOLUTION<jupyter_code>set.seed(123) # SEED
# BEGIN SOLUTION NO PROMPT
x <- runif(100)
y <- rnorm(100)
data = data.frame(x, y)
ggplot(data, aes(x=x, y=y)) +
    geom_point()
# END SOLUTION
. = " # BEGIN PROMPT
plt.plot(...);
"; # END PROMPT<jupyter_output><empty_output><jupyter_text>END SOLUTION  END QUESTION<jupyter_code>This cell is not part of a question.<jupyter_output><empty_output><jupyter_text>y = 3<jupyter_code># BEGIN QUESTION
name: q3
points: 2<jupyter_output><empty_output><jupyter_text>**Question 3.** Define `square` and assign `nine` to 3 squared.<jupyter_code># BEGIN SOLUTION<jupyter_output><empty_output><jupyter_text>square = function(x) {    y = x * x  SOLUTION    return(y)  SOLUTION}nine = square(3)  SOLUTION<jupyter_code># END SOLUTION
# BEGIN TESTS<jupyter_output><empty_output><jupyter_text>testthat::expect_equal(nine, 9) testthat::expect_equal(square(16), 256) testthat::expect_equal(square(1), 1)<jupyter_code># END TESTS
# END QUESTION
# BEGIN QUESTION
name: q4
points: 2
manual: True<jupyter_output><empty_output><jupyter_text>**Question 4.** What does equilateral mean?<jupyter_code># BEGIN SOLUTION<jupyter_output><empty_output><jupyter_text>**SOLUTION**: Having equal side lengths.<jupyter_code># END SOLUTION
# END QUESTION<jupyter_output><empty_output><jupyter_text>this isn't part of a question it's here to make sure that we get a MD cell above to close the export of question 4<jupyter_code># BEGIN QUESTION
name: question5<jupyter_output><empty_output><jupyter_text>**Question 5.** Approximate the area and circumference of a circle with radius 3.<jupyter_code># BEGIN SOLUTION<jupyter_output><empty_output><jupyter_text>pi = 3.14if (TRUE) {     BEGIN SOLUTION    radius = 3    area = radius * pi * pi     END SOLUTION    print(paste0('A circle with radius', radius, 'has area', area))}circumference = function(r) {     BEGIN SOLUTION NO PROMPT    return(2 * pi * r)     END SOLUTION    "  BEGIN PROMPT     Next, define a circumference function.    ";  END PROMPT}<jupyter_code># END SOLUTION
# END QUESTION<jupyter_output><empty_output><jupyter_text>This question has no tests.<jupyter_code># BEGIN QUESTION
name: question6
manual: true<jupyter_output><empty_output><jupyter_text>**Question 6.** Write something_This question has a custom prompt below, so that prompt should be in the output. It also has no solution!_<jupyter_code># BEGIN PROMPT<jupyter_output><empty_output><jupyter_text>_Write your thing here._<jupyter_code># END PROMPT
# END QUESTION
# BEGIN QUESTION
name: q7
manual: true<jupyter_output><empty_output><jupyter_text>**Question 7:** What is the answer?<jupyter_code># BEGIN SOLUTION<jupyter_output><empty_output><jupyter_text>SOLUTION: 42<jupyter_code># END SOLUTION
# END QUESTION
# BEGIN QUESTION
name: q8<jupyter_output><empty_output><jupyter_text>**Question 8:** Test intercell seeding by generating 10 random $N(4,2)$ numbers.<jupyter_code># BEGIN SOLUTION<jupyter_output><empty_output><jupyter_text>set.seed(42)  SEEDz = rnorm(10, 4, 2)  SOLUTIONz<jupyter_code># END SOLUTION
# BEGIN TESTS<jupyter_output><empty_output><jupyter_text>testthat::expect_equal(length(z), 10)  HIDDENactual = c(    6.74191689429334,    2.87060365720782,    4.72625682267468,    5.26572520992208,     4.808536646282,     3.78775096781703,     7.02304399487788,     3.8106819231738,     8.03684742775408,     3.87457180189516)testthat::expect_equal(actual, z)<jupyter_code># END TESTS
# END QUESTION<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.116794731064764, 'fraction_numerical': 0.048298572996706916, 'mean_word_length': 6.978984238178634, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 96, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '24', 'dir': 'jupyter-structured-clean-dedup', 'id': '198922', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1926, 'n_tokens_neox': 1713, 'n_words': 353, 'path': 'test/test-assign/r-example.ipynb', 'repo_name': 'chrispyles/otter-grader', 'size': '4555'}