Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Labeling List Elements | Section
Essential R Programming for Absolute Beginners - 1768563985826

bookLabeling List Elements

List elements can be given labels to make them easier to identify and work with.

Assigning Labels on List Creation

To assign labels during the list creation, use the syntax name = value (without quotes around the name) in the list() function.

Example

12
test <- list(text = "Text", number = 42, logical = TRUE) test
copy

Assigning Labels to an Existing List

If the list is already created, you can add labels afterward by assigning a vector of labels to names(list).

Example

123
test <- list("Text", 42, TRUE) names(test) <- c('text', 'number', 'logical') test
copy
Завдання

Swipe to start coding

You have a list info with course information.

Your task is to:

  1. Use the names() function to assign the following names to its elements: 'Course name', 'Section', 'Chapter', 'Chapter overall'.
  2. Output the resulting list.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 42
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

close

bookLabeling List Elements

Свайпніть щоб показати меню

List elements can be given labels to make them easier to identify and work with.

Assigning Labels on List Creation

To assign labels during the list creation, use the syntax name = value (without quotes around the name) in the list() function.

Example

12
test <- list(text = "Text", number = 42, logical = TRUE) test
copy

Assigning Labels to an Existing List

If the list is already created, you can add labels afterward by assigning a vector of labels to names(list).

Example

123
test <- list("Text", 42, TRUE) names(test) <- c('text', 'number', 'logical') test
copy
Завдання

Swipe to start coding

You have a list info with course information.

Your task is to:

  1. Use the names() function to assign the following names to its elements: 'Course name', 'Section', 'Chapter', 'Chapter overall'.
  2. Output the resulting list.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 42
single

single

some-alt