Saltar al contenido principal
LibreTexts Español

8.6: Respuestas a ejercicios

  • Page ID
    149943
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Respuesta a la pregunta sobre error. Esto es:

    Código\(\PageIndex{1}\) (R):

    data <- read.table("data/bugs.txt", h=TRUE)
    hist(data$WEIGHT, breaks=c(seq(0, 100, 20))

    Aquí debería ser

    Código\(\PageIndex{2}\) (R):

    data <- read.table("data/bugs.txt", h=TRUE)
    hist(data$WEIGHT, breaks=c(seq(0, 100, 20)))

    Por cierto, los corchetes no emparejados (y también las cotizaciones no emparejadas) se encuentran entre los errores más frecuentes en R.

    Aún más, la función seq () hace vector así que la función c () es innecesaria y la mejor variante del mismo comando es

    Código\(\PageIndex{3}\) (R):

    data <- read.table("data/bugs.txt", h=TRUE)
    hist(data$WEIGHT, breaks=seq(0, 100, 20))

    Ahora la verdad es que hay dos errores en el texto. Lo sentimos, pero creemos que te ayudará a entender mejor el código R. Segundo no es el error sintáctico, es más como la inconsistencia entre el texto y el ejemplo. Por favor encuéntralo tú mismo.


    This page titled 8.6: Respuestas a ejercicios is shared under a Public Domain license and was authored, remixed, and/or curated by Alexey Shipunov via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.