Basic Functions Flashcards

1
Q

What function should I call to round up a number? What package do I need to load?

A

ceiling( )

No package needs to be loaded since this function is from base package.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can I check the version of a package?

A

By calling function:

packageVersion(“tidyverse”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can I find the file path of a specific R package in my system?

A

system.file(package = “tidyverse”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What function do I call to see a brief description of a package? How does the function do that?

A

packageDescription(“tidyverse”)

It parses the DESCRIPTION file of the package and returns it as an object of class “packageDescription”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can I search for all the available functions that start with “read” ?

A

apropos(“^read”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can I get the list of functions/objects within a specific package? What’s the type and class of the returned object?

A

ls(“package:readr”)

It returns a character vector with them names of the functions. Class and type are character.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can I get the list of functions/objects within a specific package starting with a specific word?

A

ls(“package:readr”) %>%

str_subset(“^read_”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a vignette and how do I use one?

A

Vignettes are optional suplemental documentation provided by packages that look more like Tutorials.

I can access a vignette of a package using function vignette provided by utils:

vignette(“readr”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Qual função eu uso para declarar polinômios?

A

poly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly