LEZIONE 1 Flashcards

1
Q
  1. Quali sono i comandi di aiuto in R?

1) qt; help(qt); help.start ()
2) qt; help(qt); help.start (); help.search ()
3) help.start (); help.search ()
4) help(qt); help.start (); help.search ()

A

2
qt; help(qt); help.start (); help.search ()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  1. Per settare la directory di lavoro giusta e una nuova directory quali comandi di R si utilizzano?

1) etwd () ; etwd()
2) betwd () ; setwd()
3) getwd () ; tetwd()
4) getwd () ; setwd()

A

4
getwd () ; setwd()

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

Per importare un file Excel senza il nome della colonna nella prima riga quale comando di R si utilizza?

1) prova read.csv2(“c:/mydat/prova.csv”, header=TRUE)

2) prova <- read.csv2(“c:/mydat/prova.csv”, header=TRUE)

3) prova <- read.csv2(“c:/mydat/prova.csv”)

4) prova <- read.csv2(c:/mydat/prova.csv, header=TRUE)

A

2
prova <- read.csv2(“c:/mydat/prova.csv”, header=TRUE)

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

Per importare il file di testo “prova.txt” quale linea di codice di R si utilizza?

  1. prova <- scan(“c:/mydat/prova.txt”)
  2. prova scan(“c:/mydat/prova.txt”)
  3. prova <- scan(“/mydat/prova.txt”)
  4. prova <- scan(“c:/mydat/prova”)
A

1
prova <- scan(“c:/mydat/prova.txt”)

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

Con quali linee di codice di R i vettori a e b si possono trasformare da vettori riga in vettori colonna e viceversa?

  1. cbind (a, b); dbind (a, b)
  2. cbind (a, b); rbind (a, b)
  3. cbind (a, b); qbind (a, b)
  4. pbind (a, b); rbind (a, b)
A

2
cbind (a, b); rbind (a, b)

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

Se si vogliono staccare ed utilizzare singolarmente le colonne che compongono il data frame “prova” quali linee di codice si implementano?

  1. attach(prova)
  2. mediana (prova)
  3. media(prova)
  4. detach(prova)
A

1
attach(prova)

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

Se si vogliono riattaccare le colonne che compongono un data frame “prova” quali linee di codice si implementano?

  1. media(prova)
  2. mediana (prova)
  3. detach(prova)
  4. attach(prova)
A

3
detach(prova)

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

Quale linea di codice si implementa per ordinare i dati del vettore x in modo crescente?

  1. dort(x)
  2. sort()
  3. sort(x)
  4. port(x)
A

3
sort(x)

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

Quale comando di R si deve usare per caricare un data frame presente in R, ad esempio mtcars?

  1. data.frame ()
  2. df. mtcars
  3. data.frame (mtcars)
  4. df(mtcars)
A

3
data.frame (mtcars)

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