Question

Using rscript Assign the name ‘today’ to today’s date in the following format: Feb 15 2018,...

Using rscript

Assign the name ‘today’ to today’s date in the following format: Feb 15 2018, and print it. Then, check the class of ‘today’ with class(today). Show the class of ‘today’. b) The class of ‘today’ in a) is not “Date”. Please convert it to the class ‘Date’ and assign the name ‘today.Date’. Then, check the class of ‘today.Date’ with class(today.Date). Show the class of ‘today.Date’.

Homework Answers

Answer #1

Firstly taking the variable today and assigning value 11 Sept 2019

> today<-"10 Feb 2019"

Now to print the value we use the print function in R

> print(today)

now class() function will give the data type

> class(today)

now it will print as character

now to convert character to Date we have a function as.Date("date",format)

now we assign the variable today.Date using this function

today.Date<-as.Date(today, "%d%B%Y")

now check the class of today.Date variable

>class(today.Date)

now you will see the class as Date

Using as.Date() function we can convert from "character" to "Date" class

check the screenshot below for clear understanding:

##for any queries do comment below feel free to comment

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
USING R SCRIPT a) Create a list containing the following list components, and assign the name...
USING R SCRIPT a) Create a list containing the following list components, and assign the name ‘myportfolio’ to the list. listname: My portfolio stockpriceA: (122.0, 120.5, 191.7, 197.2, 199.5) stockpriceB: (58.6, 56.2, 57.9, 53.1, 54.5) stockpriceC: (102.5, 103.3, 104.5, 103.1, 102.6) b) Create a list with names of the following components, and assign the name ‘newportfolio’ to the list. Portfolio: My portfolio Apple: stockpriceA Samsung: stockpriceB Microsoft: stockpriceC c) Create a list containing correlation among stockpriceA, stockpriceB, and stockpriceC and...
A) Today is February​ 15, 2008 Type. Issue Date.   Price. Coupon Rate.   Maturity Date.    YTM....
A) Today is February​ 15, 2008 Type. Issue Date.   Price. Coupon Rate.   Maturity Date.    YTM.   Current Yield. Rating. Note Feb 2003. ? 6.75% 2-15-2013. 5.532%. ------- AAA What is the price in dollars of the February 2003 Treasury note with semiannual payment if its par value is ​$100,000​? What is the current yield of this​ note? B) Today is February​ 15, 2008 Type. Issue. Date. Price​ (per $100 par ​value) Coupon Rate.    Maturity Date. YTM.    Current Yield....
Create your own date class. Create a MyDate class with these methods. A constructor that accepts...
Create your own date class. Create a MyDate class with these methods. A constructor that accepts a month, day, and year A method that determines if the year is a leap year A method that returns the date in this format, "1/9/2020" A method that returns the date in this format, "January 9, 2020" A method that returns the day A method that returns the name of the month A method that returns the number of days in the month...
Assignment Statement Use the skeleton file starter code (below) to create the following classes using inheritance:...
Assignment Statement Use the skeleton file starter code (below) to create the following classes using inheritance: ⦁   A base class called Pet ⦁   A mix-in class called Jumper ⦁   A Dog class and a Cat class that each inherit from Pet and jumper ⦁   Two classes that inherit from Dog: BigDog and SmallDog ⦁   One classes that inherit from Cat: HouseCat The general skeleton of the Pet, Dog, and BigDog classes will be given to you (see below, "Skeleton", but...
Journalize following entries in 2014 Gen Journal using the following format. 3/31/2014 - Record the depreciation...
Journalize following entries in 2014 Gen Journal using the following format. 3/31/2014 - Record the depreciation for all buildings for the year. Management estimates annual depreciation as the amount to the right. 13,259,717 3/31/2014 - Record the depreciation for all equipment for the year. Management estimates annual depreciation as the amount to the right. 12,730,809 3/31/2014 - Even though the Bond from event 3 above will not be paid this year, Tech Co needs to record an adjusting entry as...
Assume that today is December 31, 2018, and that the following information applies to Abner Airlines:...
Assume that today is December 31, 2018, and that the following information applies to Abner Airlines: After-tax operating income [EBIT(1 - T)] for 2019 is expected to be $500 million. The depreciation expense for 2019 is expected to be $180 million. The capital expenditures for 2019 are expected to be $400 million. No change is expected in net operating working capital. The free cash flow is expected to grow at a constant rate of 6% per year. The required return...
The following information are offered to you for X Company Account Name 2019 2018 Inventory 65,000...
The following information are offered to you for X Company Account Name 2019 2018 Inventory 65,000 50,000 Accounts payable         65,000 55,000 Other information: ·         COGS at 2019 is $35,000. ·         Cash receipts from customers at 2019 is $95,000 ·         Cash paid for operating expenses at 2019 is $ 30,000. Using direct method, the net cash flows from operations are: Select one: a. $25,000 b. $40,000 c. $30,000 d. $65,000 e. All answers are wrong
Perform the following using 10-bit floating point notation having the format SEEEMMMMMM: a. Decode 1101110110 to...
Perform the following using 10-bit floating point notation having the format SEEEMMMMMM: a. Decode 1101110110 to decimal integer and/or fraction. b. Decode 0001100000 to decimal integer and/or fraction. c. Encode: -5/32 d. Encode: +6 and 5/8 If someone could send the answer with explanations please do. It will be greatly appreciated.
Your company has made the following promises to a group of employees who are retiring today:...
Your company has made the following promises to a group of employees who are retiring today: a cash flow of $300 1 year from today, a cash flow of $500 2 years from today, a cash flow of $600 3 years from today? Assume all investments earn an annual interest rate of 15%, compounded annually. (The discount rate is 15%). The company has set aside $1100 to meet those obligations. Is the retirement fund under-funded or over-funded? a.   under-funded b.  ...
Debra acquired the following new assets during 2018: Date Asset Cost April 11 Furniture $40,000 July...
Debra acquired the following new assets during 2018: Date Asset Cost April 11 Furniture $40,000 July 28 Trucks 40,000 November 3 Computers 70,000 Debra does not elect immediate expensing under § 179. She does not claim any available additional first-year depreciation. If required, round your answers to the nearest dollar. a. What MACRS convention applies to the assets? Mid-quarte b. What class of property is each asset for MACRS? Furniture: Seven-year Trucks: Five-year Computers: Five-year c. The cost recovery deductions...