1. Học hỏi
  2. /
  3. Khoa Học
  4. /
  5. Intermediate R

Connected

Bài tập

Different ways to load a package

The library() and require() functions are not very picky when it comes down to argument types: both library(rjson) and library("rjson") work perfectly fine for loading a package.

Have a look at some more code chunks that (attempt to) load one or more packages:

# Chunk 1
library(data.table)
require(rjson)

# Chunk 2
library("data.table")
require(rjson)

# Chunk 3
library(data.table)
require(rjson, character.only = TRUE)

# Chunk 4
library(c("data.table", "rjson"))

Select the option that lists all of the chunks that do not generate an error. The console is yours to experiment in.

Hướng dẫn

50 XP

Các phương án trả lời