Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Transposing Matrices | Section
Practice
Projects
Quizzes & Challenges
Quizer
Challenges
/
Essential R Programming for Absolute Beginners - 1768563985826

bookTransposing Matrices

Transposition is the operation of swapping the rows and columns of a matrix. In R, this is done with the t() function.

Example

123456
# Initial matrix m <- matrix(1:6, nrow = 2) m # Transposed matrix t(m)
copy

The original matrix has 2 rows and 3 columns. After transposition, it becomes 3 rows and 2 columns.

Oppgave

Swipe to start coding

You have a vector num. Your goal is to:

  1. Build a matrix from num and assign it to the m variable.
  2. Output the transposed m matrix.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 29
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookTransposing Matrices

Sveip for å vise menyen

Transposition is the operation of swapping the rows and columns of a matrix. In R, this is done with the t() function.

Example

123456
# Initial matrix m <- matrix(1:6, nrow = 2) m # Transposed matrix t(m)
copy

The original matrix has 2 rows and 3 columns. After transposition, it becomes 3 rows and 2 columns.

Oppgave

Swipe to start coding

You have a vector num. Your goal is to:

  1. Build a matrix from num and assign it to the m variable.
  2. Output the transposed m matrix.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 29
single

single

some-alt