Question

Write the code to return the output: Code: mylist <- list(c(2020,2021),c("Jan", "Feb"), c("Mon", "Thurs")) Output must...

Write the code to return the output: Code: mylist <- list(c(2020,2021),c("Jan", "Feb"), c("Mon", "Thurs"))

Output must be:

$Year

[1] 2020 2021

$Month

[1] "Jan" "Feb"

$Day [1] "Mon" "Thurs"

Homework Answers

Answer #1

Lists are the R objects which contain elements of different types like for example --> numbers, strings, vectors and another list inside it.

################### CODE BELOW #################

#list assigning value
my_list <- list(c(2020,2021),c("Jan", "Feb"), c("Mon", "Thurs"))

# Give names to elements
names(my_list) <- c("Year", "Month", "Day")
#printing the list
print(my_list)
################ CODE END ####################

Code Output shows below

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
Write the code to return the output: Code: id <- c(5, 6, 7, 8, 9) prod...
Write the code to return the output: Code: id <- c(5, 6, 7, 8, 9) prod <- c("F", "H", "B", "S", "D") units <- c(12, 19, 44,26, 43) df <- data.frame(id, prod, units) Output must be: [1] 12 19 44 26 43
PHP Question: _____________________________________________ Write the PHP code to list out all of the dates of the...
PHP Question: _____________________________________________ Write the PHP code to list out all of the dates of the current month and assign them to their given days. As an example, for the month of October 2020, the output should look something like this: October 2020       Monday: 5, 12, 19, 26 Tuesday: 6, 13, 20, 27 Wednesday: 7, 14, 21, 28 Thursday: 1, 8, 15, 22, 29 Friday: 2, 9, 16, 23, 30 Saturday: 3, 10, 17, 24, 31 Sunday: 4,...
Year Month Return Year Month Return 2006     Jan 3.95 2008     Jul 3.29 2006     Feb 3.77 2008...
Year Month Return Year Month Return 2006     Jan 3.95 2008     Jul 3.29 2006     Feb 3.77 2008     Aug 4.62 2006     Mar 5.29 2008     Sep 4.81 2006     Apr 3.77 2008     Oct 5.16 2006     May 4.47 2008     Nov 3.69 2006     Jun 5.2 2008     Dec 5.15 2006     Jul 3.9 2009     Jan 5.29 2006     Aug 4.33 2009     Feb 3.19 2006     Sep 4.41 2009     Mar 3.89 2006     Oct 5.14 2009     Apr 4.48 2006     Nov 3.24 2009     May 5.27 2006     Dec 4.13 2009     Jun 3.93 2007     Jan...
Write a SQL code that finds how many days away from thanksgiving. The code should work...
Write a SQL code that finds how many days away from thanksgiving. The code should work in any month in this year 2020. write a code to find the oldest person from a table has an age column. NOTE: please use ssms to write the code with a screenshot of the output.
How do I get this portion of my List Iterator code to work? This is a...
How do I get this portion of my List Iterator code to work? This is a portion of the code in the AddressBookApp that I need to work. Currently it stops at Person not found and if it makes it to the else it gives me this Exception in thread "main" java.lang.NullPointerException    at AddressBookApp.main(AddressBookApp.java:36) iter.reset(); Person findPerson = iter.findLastname("Duck"); if (findPerson == null) System.out.println("Person not found."); else findPerson.displayEntry(); findPerson = iter.findLastname("Duck"); if (findPerson == null) { System.out.println("Person not found.");...
Write the code in C# List the evens or the odds. You are given a lower...
Write the code in C# List the evens or the odds. You are given a lower and an upper bound for a range of integer numbers. Then a command specifies if you need to list all even or odd numbers in the given range.
1. Please write the following in C++ also please show all output code and comment on...
1. Please write the following in C++ also please show all output code and comment on code. 2. Also, use CPPUnitLite to write all test and show outputs for each test. Write CppUnitLite tests to verify correct behavior for all the exercises. The modifications are aimed at making the exercises more conducive to unit tests. Write a function that swaps (exchanges the values of two integers). Use int* as the argument type. Write a second swap function using a reference...
The sales budget is provided below for the product of Company ABC. Jan 30,000 units Feb...
The sales budget is provided below for the product of Company ABC. Jan 30,000 units Feb 20,000 units Mar 10,000 units Apr 20,000 units May 30,000 units Finished goods at the end of each month must be 10% of the next month’s budgeted sales. On Dec 31 of the last year, the finished goods totaled 2,000 units. The selling price is $1 per unit. 80% of the credit sales are collected in the month of sale, 15% in the month...
Please read the requirements: Write a C++ function, date, that will accept a date via a...
Please read the requirements: Write a C++ function, date, that will accept a date via a parameter in the month-day-year format, mmddyyyy, (e.g., 10262020 stands for the date October 26, 2020), and then will determine the corresponding month number, day, and year of that date, returning these three integer values to the calling function via arguments. An example of a call to the function date is shown in the following statement: date (10262020, month, day, year); This call to the...
Write C language code for a function that takes a doubly linked list as a parameter...
Write C language code for a function that takes a doubly linked list as a parameter and deletes all the nodes in even positions from the first to the last after displaying the content of each node to the console.