Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

R language: Write the code in R Markdown and submit your R Markdown file here please. 1. Suppose you own stocks and watch the stock

R language: Write the code in R Markdown and submit your R Markdown file here please.
image text in transcribed
1. Suppose you own stocks and watch the stock market every day, write a function in R named "stock_advice" to tell you whether you should sell your stocks under the following conditions using if-else conditional statements: If the stock market value from today is lower than that from the average of the past 3 days, return "buy" If the stock market value from today is higher than that from the average of the past 3 days, return "sell" If the stock market value from today is the same as the average of the past 3 days, return "watch" Include 4 arguments in your function: today's value, day 1 value, day 2 value and day 3 value. Note: to get the average of the past 3 days, use (day1+day2+day3)/3 Find the predicted decision if today's stock market value is $12.11, and the last 3 days values are $10.39, $15.98, and $13.96

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems Uropean Conference Adbis 2020 Lyon France August 25 27 2020 Proceedings Lncs 12245

Authors: Jerome Darmont ,Boris Novikov ,Robert Wrembel

1st Edition

3030548317, 978-3030548315

More Books

Students also viewed these Databases questions

Question

Write a CSS selector to match all divs with class hello

Answered: 1 week ago

Question

Consider this article:...

Answered: 1 week ago