x <- seq(-5, 5, length = 100)
# Hint: Use the plot functionProblem set 1
After finishing the homework, you are to turn in all the code to GitHub using git.
Start an RStudio project. Pick a good name following a naming convention. Start a Quarto document called
beginning.qmd.Create a directory called
imgand save a screen shot of your RStudio session for the project. Include your screenshot in the Quarto document.Next, in your Quarto document, define variables \(a=1, b=-1, c=-2\) and print out the solutions to \(f(x) = ax^2+bx+c=0\). Do not report complex solutions, only real numbers.
Include a graph of \(f(x)\) versus \(x\) for \(x \in (-5,5)\).
- Create a directory called
docs. Use the commandquarto renderto create a PDF and save it to thedocsdirectory. Show us the command you typed:
# Your code here
- Use Unix to create a directory called
datain the project home directory. Include the Unix command you used to create the directory.
# Your code here
- Use a terminal-based text editor to create a file
coefs.txtin thedatadirectory and save three coefficients,1 -1 -2for example. Show us the Unix commands you used to achieve this:
# Your code here
- Make a directory called
code. Use Unix to copy the filebeginning.qmdto a file calledquadratic.qmdin the code directory. Show us the Unix commands you used.
# Your code here
Edit the
quadratic.qmdfile to read ina,b, andcfrom the filecoefs.txt. Make sure to use a relative path when reading the file. As before, print out the solutions to \(f(x) = ax^2+bx+c=0\). Do not report complex solutions, only real numbers.Change the path of the file you are reading to the full path you get when you type
file.path(getwd(), "data/coefs.txt"). Confirm that the file still renders. Then move the entirepset-01-rmarkdownproject to a directory calledRtmpyDknq4. Does the file render? Change the path back to a relative path and see if it renders.