Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The data provided on SUNLearn is in a folder named Scripts . Multiple programming scripts were downloaded from GitHub. However, as life would have it
The data provided on SUNLearn is in a folder named Scripts Multiple programming scripts were
downloaded from GitHub. However, as life would have it there are some other files in the folder that do not
contain the target coding languages we are looking for.
As a first step, you need to develop a function that stores the names of all the files inside the folder
Scripts in a list. Create a function named fGetfiles with a single argument filefolder The
argument filefolder is used to specify the name of the folder that contains the data ie "Scripts"
The function fGetfiles should return a list where:
the list only includes R and Python files. R files have the extension r or R while Python
files end with py
the length of the list should be equal to the total number of R and Python files inside the
Scripts folder
each element of the list should store the file name as a string.
Finally, assign an object named listfiles to the output from the fGetfiles function.
Provide your answer in the code chunk getfiles : I would like to clarify the work done on my data science course cover dplyr Lubridate, stringR, ggplot Tidyverse, and tidy models the question I ask should be explained and broken down using functions and packages from these ecosystem. The code must also pass this test if lengthfGetfilesScripts
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