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 list details the returns on 10 investment funds for the period 2009 - 2018....
The following list details the returns on 10 investment funds for the period 2009 - 2018. The information listed is year, name, percentage return. You are considering investing in one or more of the funds. You are to develop methods (7) that will (using the data below): Calculate the average annual return for each fund (print the average) Find the fund with the highest average return (print the fund name, year and return) Find the fund with the lowest average...
Create the ER Diagram by using the following information. Department Information A department has a name,...
Create the ER Diagram by using the following information. Department Information A department has a name, a web address, a main phone number, an email address and a main mailing address. The address contains street number, street name, city, zip code and state. The entire department address can also be retrieved as a unit. Building Information A building of a campus has a name, number of rooms, number of floors, and a mailing address (similar in format to department address)....
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.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT