[R-es] mensaje de error al usar libreria tibbletime

Carlos Ortega cof en qualityexcellence.es
Mar Nov 21 14:55:51 CET 2017


Hola,

Así funciona:

> library(tibbletime)> library(data.table)> datIn <- fread("iridium.txt")> a <- as_tbl_time(datIn,index = date)Error: Specified `index` is not time based> > library(lubridate)> datIn$mydate <- ymd_hms(datIn$date)> a_new <- as_tbl_time(datIn,index = mydate)> a_new# A time tibble: 8,335 x 16
# Index: mydate
                 date batt_volt_Min Rshort_up Rshort_dn
long_up_corr_Avg long_dn_corr_Avg
                <chr>         <dbl>     <dbl>     <dbl>
<dbl>            <dbl>
 1 2016/02/08 0:00:00         12.67    -1.360     5.985
336.6            329.2
 2 2016/02/08 1:00:00         12.58    -2.376     4.291
335.6            329.2
 3 2016/02/08 2:00:00         12.54    -3.297     4.259
329.5            329.2
 4 2016/02/08 3:00:00         12.52    -2.461     2.009
331.4            328.4
 5 2016/02/08 4:00:00         12.49    -2.665     2.407
335.8            328.2
 6 2016/02/08 5:00:00         12.46    -2.658     4.423
337.7            328.8
 7 2016/02/08 6:00:00         12.43    -2.039     3.843
338.9            328.8
 8 2016/02/08 7:00:00         12.40    -0.953     3.141
338.9            328.8
 9 2016/02/08 8:00:00         12.39    14.610     9.980
339.0            328.8
10 2016/02/08 9:00:00         12.44    61.300    31.470
338.4            328.9
# ... with 8,325 more rows, and 10 more variables: WinVel_Avg <dbl>,
WinDir_Avg <dbl>,
#   Taire_Avg <dbl>, Haire_Avg <dbl>, RTD_C_Avg <dbl>, BP_hPA_Avg <int>,
#   AltN_corr_Avg <dbl>, ejex_Avg <dbl>, ejey_Avg <dbl>, mydate <dttm>


El problema es que a la hora de importar el fichero, por defecto "date" no
tiene formato fecha, hay que dársela...
Y en cuanto ya tiene formato fecha, todo funciona...

Saludos,
Carlos Ortega
www.qualityexcellence.es


El 21 de noviembre de 2017, 13:54, Javier Valdes Cantallopts (DGA) <
javier.valdes en mop.gov.cl> escribió:

> Carlos:
>
> Envío tabla con datos para prueba.
>
>
>
> [image: Descripción: FIRMA3]
>
>
>
> *De:* Carlos Ortega [mailto:cof en qualityexcellence.es]
> *Enviado el:* lunes, 20 de noviembre de 2017 18:01
> *Para:* Javier Valdes Cantallopts (DGA)
> *CC:* r-help-es en r-project.org
> *Asunto:* Re: mensaje de error al usar libreria tibbletime
>
>
>
> Hola,
>
>
>
> Si compartes una parte de tus datos, hasta a lo mejor lo podemos
> reproducir...
>
>
>
> Gracias,
>
> Carlos Ortega
>
> www.qualityexcellence.es
>
>
>
> El 20 de noviembre de 2017, 19:31, Javier Valdes Cantallopts (DGA) <
> javier.valdes en mop.gov.cl> escribió:
>
> Hola  A todos.
>
> Aún no he podido encontrar la causa de porqué la libraría tibbletime, al
> transformar la tabla a *AS_TBL_TIME* ME ARROJA EL SIGUIENTE EL SIGUIENTE
> MENSAJE
>
>
>
> Error: assert_that: assertion must return a logical value
>
>
>
> Si alguien ha tenido ese mismo problema, solicito ayuda al foro.
>
>
>
> El seguimiento de la transformación es el siguiente;
>
>
>
> library(tibbletime)
>
> a<-read.table("iridium.txt",header = T, sep = "\t")
>
> a<-as_tbl_time(a,index = date)
>
>
>
> Error: assert_that: assertion must return a logical value
>
>
>
> [image: Descripción: FIRMA3]
>
>
>
>
> ------------------------------
>
>
> CONFIDENCIALIDAD: La información contenida en este mensaje y/o en los
> archivos adjuntos es de carácter confidencial o privilegiada y está
> destinada al uso exclusivo del emisor y/o de la persona o entidad a quien
> va dirigida. Si usted no es el destinatario, cualquier almacenamiento,
> divulgación, distribución o copia de esta información está estrictamente
> prohibido y sancionado por la ley. Si recibió este mensaje por error, por
> favor infórmenos inmediatamente respondiendo este mismo mensaje y borre
> todos los archivos adjuntos. Gracias.
>
> CONFIDENTIAL NOTE: The information transmitted in this message and/or
> attachments is confidential and/or privileged and is intented only for use
> of the person or entity to whom it is addressed. If you are not the
> intended recipient, any retention, dissemination, distribution or copy of
> this information is strictly prohibited and sanctioned by law. If you
> received this message in error, please reply us this same message and
> delete this message and all attachments. Thank you.
>
>
>
>
> --
>
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es
>
> ------------------------------
>
> CONFIDENCIALIDAD: La información contenida en este mensaje y/o en los
> archivos adjuntos es de carácter confidencial o privilegiada y está
> destinada al uso exclusivo del emisor y/o de la persona o entidad a quien
> va dirigida. Si usted no es el destinatario, cualquier almacenamiento,
> divulgación, distribución o copia de esta información está estrictamente
> prohibido y sancionado por la ley. Si recibió este mensaje por error, por
> favor infórmenos inmediatamente respondiendo este mismo mensaje y borre
> todos los archivos adjuntos. Gracias.
>
> CONFIDENTIAL NOTE: The information transmitted in this message and/or
> attachments is confidential and/or privileged and is intented only for use
> of the person or entity to whom it is addressed. If you are not the
> intended recipient, any retention, dissemination, distribution or copy of
> this information is strictly prohibited and sanctioned by law. If you
> received this message in error, please reply us this same message and
> delete this message and all attachments. Thank you.
>



-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20171121/5cf4a4ec/attachment-0001.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 33786 bytes
Desc: no disponible
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20171121/5cf4a4ec/attachment-0001.png>


Más información sobre la lista de distribución R-help-es