Question

Question 5 0/1 point (graded) The following is the full path to a homework assignment file...

Question 5

0/1 point (graded)

The following is the full path to a homework assignment file called "assignment.txt": /Users/student/Documents/projects/homeworks/assignment.txt.

Which line of code will allow you to move the assignment.txt file from the “homeworks” directory into the parent directory “projects”?

mv assignment.txt

mv assignment.txt .

mv assignment.txt ..

mv assignment.txt /projects incorrect

Answer

Incorrect:

Try again. This code does not provide enough information about where to move the file. You need to specify a relative or full path to the location where you want to move the file to.

Question 9

0/1 point (graded)

The source function reads a script from a url or file and evaluates it. Check ?source in the R console for more information.

Suppose you have an R script at ~/myproject/R/plotfig.R and getwd() shows ~/myproject/result, and you are running your R script with source('~/myproject/R/plotfig.R').

Which R function should you write in plotfig.R in order to correctly produce a plot in ~/myproject/result/fig/barplot.png?

ggsave('fig/barplot.png'), because this is the relative path to the current working directory.

ggsave('../result/fig/barplot.png'), because this is the relative path to the source file ("plotfig.R"). incorrect

ggsave('result/fig/barplot.png'), because this is the relative path to the project directory.

ggsave('barplot.png'), because this is the file name.

Question 12

1 point possible (graded)

Which of the following meanings for options following less are not correct?

(Hint: use man less to check.)

-g: Highlights current match of any searched string

-i: case-insensitive searches

-S: automatically save the search object

-X: leave file contents on screen when less exits.

Question 13

1 point possible (graded)

Which of the following statements is incorrect about preparation for a data science project?

Select ALL that apply.

Always use absolute paths when working on a data science project.

Saving .RData every time you exit R will keep your collaborator informed of what you did.

Use ggsave to save generated files for use in a presentation or a report.

Saving your code in a Word file and inserting output images is a good idea for making a reproducible report.

Homework Answers

Answer #1

Question 5

The following is the full path to a homework assignment file called "assignment.txt": /Users/student/Documents/projects/homeworks/assignment.txt.

Which line of code will allow you to move the assignment.txt file from the “homeworks” directory into the parent directory “projects”?

mv assignment.txt

mv assignment.txt .

mv assignment.txt ..

mv assignment.txt /projects

Answer : mv assignment.txt ..

syntax to move file is : mv filename directoryPath

To denote parent directory we use ".." (double dots) in unix. Hence in the above question it is  mv assignment.txt ..

******************************

Question 9

The source function reads a script from a url or file and evaluates it. Check ?source in the R console for more information.

Suppose you have an R script at ~/myproject/R/plotfig.R and getwd() shows ~/myproject/result, and you are running your R script with source('~/myproject/R/plotfig.R').

Which R function should you write in plotfig.R in order to correctly produce a plot in ~/myproject/result/fig/barplot.png?

Answer : ggsave('fig/barplot.png'), because this is the relative path to the current working directory.

While executing the script , it takes current working directory which is "~/myproject/result" . Hence to save the plot in ~/myproject/result/fig/barplot.png, have to use fig/barplot.png.

******************************

Question 12

Which of the following meanings for options following less are not correct?

(Hint: use man less to check.)

Answer : -S: automatically save the search object

-g: Highlights current match of any searched string ->correct

-i: case-insensitive searches ->correct

-S: automatically save the search object ->incorrect (-S means Chop (truncate) long lines rather than wrapping.)

-X: leave file contents on screen when less exits. ->correct

******************************

Question 13

Which of the following statements is incorrect about preparation for a data science project?

Select ALL that apply.

Answer :

Always use absolute paths when working on a data science project. ->(You should never use absolute paths in your scripts, because they hinder sharing: no one else will have exactly the same directory configuration as you.)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I did already posted this question before, I did get the answer but i am not...
I did already posted this question before, I did get the answer but i am not satisfied with the answer i did the code as a solution not the description as my solution, so i am reposting this question again. Please send me the code as my solution not the description In this project, build a simple Unix shell. The shell is the heart of the command-line interface, and thus is central to the Unix/C programming environment. Mastering use of...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
The Business Case for Agility “The battle is not always to the strongest, nor the race...
The Business Case for Agility “The battle is not always to the strongest, nor the race to the swiftest, but that’s the way to bet ’em!”  —C. Morgan Cofer In This Chapter This chapter discusses the business case for Agility, presenting six benefits for teams and the enterprise. It also describes a financial model that shows why incremental development works. Takeaways Agility is not just about the team. There are product-management, project-management, and technical issues beyond the team’s control. Lean-Agile provides...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From...
Sign In INNOVATION Deep Change: How Operational Innovation Can Transform Your Company by Michael Hammer From the April 2004 Issue Save Share 8.95 In 1991, Progressive Insurance, an automobile insurer based in Mayfield Village, Ohio, had approximately $1.3 billion in sales. By 2002, that figure had grown to $9.5 billion. What fashionable strategies did Progressive employ to achieve sevenfold growth in just over a decade? Was it positioned in a high-growth industry? Hardly. Auto insurance is a mature, 100-year-old industry...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT