Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Numeric Types | Section
Practice
Projects
Quizzes & Challenges
Cuestionarios
Challenges
/
Essential R Programming for Absolute Beginners - 1768563985826

bookNumeric Types

By default, numeric values in R are stored as double-precision floating-point numbers (double). To use integers or complex numbers, you must mark them explicitly.

Numeric Types

  • double: real numbers either with or without a decimal point;
  • integer: whole numbers (use L suffix, e.g., 10L);
  • complex: numbers with both real and imaginary parts (use i suffix for imaginary part).

Example

123
typeof(10) typeof(10L) typeof(10 + 5i)
copy

Integers typically require less memory than doubles, so distinguishing between them can be important for efficiency.

Tarea

Swipe to start coding

  1. Assign the current year's numerical value to a variable named year, and ensure that it is of integer type by appending L.
  2. Determine and display the type of the year variable:

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 12
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

close

bookNumeric Types

Desliza para mostrar el menú

By default, numeric values in R are stored as double-precision floating-point numbers (double). To use integers or complex numbers, you must mark them explicitly.

Numeric Types

  • double: real numbers either with or without a decimal point;
  • integer: whole numbers (use L suffix, e.g., 10L);
  • complex: numbers with both real and imaginary parts (use i suffix for imaginary part).

Example

123
typeof(10) typeof(10L) typeof(10 + 5i)
copy

Integers typically require less memory than doubles, so distinguishing between them can be important for efficiency.

Tarea

Swipe to start coding

  1. Assign the current year's numerical value to a variable named year, and ensure that it is of integer type by appending L.
  2. Determine and display the type of the year variable:

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 12
single

single

some-alt