3. Programming - R Language Flashcards
R functions - access help file
?rnorm
R functions - search help files
help.search(“rnorm”)
R functions - get arguments
args(“rnorm”
R functions - see the code
type the function name without brackets
What is the first element in a vector?
In R each variable begins in the element 1.
What does the operator “:”
This operator creates a sequence of integers
What are the R object classes?
Character Numeric (real number) Integer Complex Logical (true/false)
What restriction does Vector object has?
Can only contain objets of the same class
What is the exception for vector objects?
List vector can have different type of objects.
What does the c( ) function?
Concatenate itens
How many brackets does list vectors has?
Two
What are matrices?
Matrices are vetors with the dimension attribute: columns and rows.
How to create a matrix?
var
What types of missin values exist?
NA
NaN
Qual a função gera gráfico do timo ramo-e-folha
stem(var)
Qual a função gera um resumo da variável, como média, mediana, etc?
summary(var)
Qual a função mostra a frequência de valores de uma variável?
table(var)
Qual a função plota o resultado em um gráfico de barras?
plot(var)
Qual a função mostra somente os primeiros valores da variável?
head(var)
Qual a função mostra somente os últimos valores da variável?
tail(var)
Como adicionar uma coluna a um Data Set?
Atribua valores a nova coluna do dataset e ela é criada automaticamente.
Como remover linhas sem valor (NA) de um data set?
Utilize o argumento na.rm=TRUE ou a função na.omit( dataset )
Quais são as duas formas de passar argumentos para uma função?
- Posição do argumento na lista
2. Nome do argumento ( argumento = valor )
O que é “Lazy Evaluation” em funções do R?
Se você criar uma função com mais de uma argumento, no entanto não utilizar na função, não será gerado erro se não passar aquele argumento não utilizado ( a não ser que tem um valor padrão na definição da função).