Como ordenar mis datos que recojo de un formulario de google ?

Necesito cambiar la estructura de los datos que recojo de un formulario de google para su posterior análisis.
el primer cuadro es la manera de como ingresa la información y necesito ordenarlos como esta en el segundo cuadro.
(dejo enlace donde se encuentran los datos)

https://docs.google.com/spreadsheets/d/10A0DPbao7o1JUOgwF2q56xrbXheO9TxZd0xva2UzLwY/edit?usp=sharing

saludos

The spaces in the column headers are filled with periods. I suggest editing them.

library(tidyr)
DF <- read.csv("~/R/Play/Form_Fenologia.csv")
DF_Long <- pivot_longer(DF,7:41,names_to = c("Numero_Planta","Organo"),names_pattern = "(Planta.\\d)\\.\\.\\.(.+)")
DF_Long
#> # A tibble: 140 x 9
#>    Marca.temporal  Fecha Variedad Modulo Turno Bloque Numero_Planta Organo value
#>    <chr>           <chr> <chr>    <chr>  <chr> <chr>  <chr>         <chr>  <int>
#>  1 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.1      Boton      0
#>  2 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.1      Flor.~   175
#>  3 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.1      Flor.~   157
#>  4 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.1      Cuajo     88
#>  5 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.1      Baya.~    44
#>  6 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.1      Baya.~     2
#>  7 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.1      Baya.~     0
#>  8 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.2      Boton    177
#>  9 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.2      Flor.~   173
#> 10 1/7/2021 10:41~ 1/7/~ BILOXI   M05    T3    A      Planta.2      Flor.~   164
#> # ... with 130 more rows
DF_Long[, 7:9]
#> # A tibble: 140 x 3
#>    Numero_Planta Organo       value
#>    <chr>         <chr>        <int>
#>  1 Planta.1      Boton            0
#>  2 Planta.1      Flor.cerrada   175
#>  3 Planta.1      Flor.abierta   157
#>  4 Planta.1      Cuajo           88
#>  5 Planta.1      Baya.4.8        44
#>  6 Planta.1      Baya.8.12        2
#>  7 Planta.1      Baya..12         0
#>  8 Planta.2      Boton          177
#>  9 Planta.2      Flor.cerrada   173
#> 10 Planta.2      Flor.abierta   164
#> # ... with 130 more rows

Created on 2021-07-13 by the reprex package (v0.3.0)

Muchas gracias por tu respuesta, ahora ya se que hay funciones mas avanzadas que gather y spread.
voy a seguir viendo cual es el problema por el cual no me salen los datos en las nuevas columnas, tal vez sea por los nombres de las columnas. intentare cambiarlo y correr el código nuevamente.

The code works for me without modifying the file you posted. I do see that accented characters are not handled well so that Botón is read as Botón but there are no NA values in the Numero_Planta or Organo columns.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.