Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Before creating the final tibble, we will first develop a method that can read a file that contains code. Create a function called fRead _
Before creating the final tibble, we will first develop a method that can read a file that contains code.
Create a function called fReadcode with a single argument filepath The argument filepath is
used to specify the path to the file that should be read. The function fReadcode should:
use the function readlines from the package readr to read the file at the location specified by
the value passed to the filepath argument,
remove any characters from a line that follows the comment # symbol,
remove any trailing white spaces from a line,
remove any empty lines and
join all the lines into a single string using the newline character ie
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started