Hola, Vuelve a instalar el paquete "lubridate" y nos dices si sigues con el problema.
Saludos, Carlos Ortega www.qualityexcellence.es El 30 de agosto de 2016, 14:53, Javier Valdes Cantallopts (DGA) < javier.val...@mop.gov.cl> escribió: > Hola Carlos y a todos los miembros. > > Al llamar a “lubridate” me encontré con el siguiente problema: > > 1] date hour T > > <0 rows> (or 0-length row.names) > > Error in fetch(key) : > > lazy-load database 'C:/Program > Files/R/R-3.3.1/library/lubridate/help/lubridate.rdb' > is corrupt > > In addition: Warning message: > > In fetch(key) : internal error -3 in R_decompress1 > > Por lo que todo lo que venía después falló. Mi base de datos esta sobre un > .csv > > Encargo ayuda por favor. > > > > > > *De:* Carlos Ortega [mailto:c...@qualityexcellence.es] > *Enviado el:* lunes, 29 de agosto de 2016 20:31 > *Para:* Javier Valdes Cantallopts (DGA) > *CC:* r-help-es@r-project.org > *Asunto:* Re: [R-es] encontrar fechas saltadas > > > > Hola, > > > > "setdiff()" efectivamente funciona sobre vectores numéricos (no fechas). > > Para fechas, es mejor hacerlo de esta forma (utilizando tus datos): > > > > > > > > Lines <- "fecha hora datos > > + 20/11/12 2:00:04AM 12.905 > > + 21/11/12 3:00:04AM 12.889 > > + 22/11/12 4:00:03AM 12.873 > > + 23/11/12 5:00:03AM 12.861 > > + 29/11/12 11:00:03AM 12.804 > > + " > > > > > > datIn <- read.table(textConnection(Lines), header = TRUE, as.is = TRUE) > > > datIn > > fecha hora datos > > 1 20/11/12 2:00:04AM 12.905 > > 2 21/11/12 3:00:04AM 12.889 > > 3 22/11/12 4:00:03AM 12.873 > > 4 23/11/12 5:00:03AM 12.861 > > 5 29/11/12 11:00:03AM 12.804 > > > > > > library(lubridate) > > > datIn$myfecha <- dmy(datIn$fecha) > > > > > > dat_ref <- seq(from = min(datIn$myfecha), to = max(datIn$myfecha), by = > 1) > > > dif_df <- dat_ref[ !dat_ref %in% datIn$myfecha] > > > dif_df > > [1] "2012-11-24" "2012-11-25" "2012-11-26" "2012-11-27" "2012-11-28" > > > length(dif_df) > > [1] 5 > > > > > > > > Saludos, > > Carlos Ortega > > www.qualityexcellence.es > > > > El 29 de agosto de 2016, 22:55, <javier.ruben.marcu...@gmail.com> > escribió: > > Estimado Javier Valdes Cantallopts > > > > Entonces si es sobre números, puede pensar en segundos, milisegundos, > días, calcular el tiempo en la unidad que usted desea desde el tiempo base > al tiempo en cuestión. Los tiempos serán todos una cantidad respecto al > tiempo base que vale 0. > > > > Javier Rubén Marcuzzi > > > > *De: *Javier Valdes Cantallopts (DGA) <javier.val...@mop.gov.cl> > *Enviado: *lunes, 29 de agosto de 2016 17:45 > *Para: *javier.ruben.marcu...@gmail.com; r-help-es@r-project.org > > > *Asunto: *RE: [R-es] encontrar fechas saltadas > > > > Hola Javier. > > Quizás no me expliqué bien: > > Estoy usando esta función para identificar *fechas saltadas* de una base > de datos en formato d/m/A; > > > > > mi_serie <- c > > > ref_serie <- seq(from = min(mi_serie), to = max(mi_serie) ) > > > > > > dif_series <- setdiff( ref_serie, mi_serie) > > > > > > dif_series > > > > > length( dif_series) > > > > El problema es que en REF_SERIE, me dice que los cálculos los debo hacer > *sobre > números*, por lo que me imagino que debo transformar las fechas a números > creo yo? lo ideal, sería mantener el formato de fecha, es posible lo > último?. > > > > fecha > > hora > > datos > > 20/11/12 > > 2:00:04 AM > > 12.905 > > 21/11/12 > > 3:00:04 AM > > 12.889 > > 22/11/12 > > 4:00:03 AM > > 12.873 > > 23/11/12 > > 5:00:03 AM > > 12.861 > > 29/11/12 > > 11:00:03 AM > > 12.804 > > Falta los datos de las fechas 24-25-26-27-28 Y 29/11/12 > > > > > > > > > > > > *De:* javier.ruben.marcu...@gmail.com [mailto:javier.ruben.marcuzzi@ > gmail.com] > *Enviado el:* lunes, 29 de agosto de 2016 17:22 > *Para:* Javier Valdes Cantallopts (DGA); r-help-es@r-project.org > *Asunto:* RE: [R-es] encontrar fechas saltadas > > > > Estimado Javier Valdes Cantallopts > > > > Le propongo http://www.statmethods.net/input/dates.html para acomodar un > poco los datos, aunque hay muchas formas. > > > > Su correo dice FUN(X …, pienso en que usted pueda acomodar sus datos al > formato de fecha de la función que desea utilizar. > > > > Javier Rubén Marcuzzi > > > > *De: *Javier Valdes Cantallopts (DGA) <javier.val...@mop.gov.cl> > > *Enviado: *lunes, 29 de agosto de 2016 16:40 > *Para: *r-help-es@r-project.org > > *Asunto: *[R-es] encontrar fechas saltadas > > > > Hola a todos: > > > > Apliqu� el m�todo, pero me sali� lo siguiente; > > error in FUN(X[[i]], ...) : only defined on a data frame with all > numeric variables. > > Me imagino que el error surgi� ya que la tabla de valores que necesito > encontrar tengo "FECHAS", "HORA" Y NUMERO . Por ejemplo; > > fecha > > > > hora > > > > datos > > > > 20/11/12 > > > > 2:00:04 AM > > > > 12.905 > > > > 21/11/12 > > > > 3:00:04 AM > > > > 12.889 > > > > 22/11/12 > > > > 4:00:03 AM > > > > 12.873 > > > > 23/11/12 > > > > 5:00:03 AM > > > > 12.861 > > > > 29/11/12 > > > > 11:00:03 AM > > > > 12.804 > > > > Falta los datos de las fechas 24-25-26-27-28 Y 29/11/12 > > > > En este caso, para encontrar los valores saltados, que procedimiento > debiese ocupar sabiendo los "tipos" de datos que tengo? Deber�a pasar a d�a > juliano las fechas? Y con las horas? Como lo har�a? > > Saludos y gracias. > > > > > > ________________________________ > > > > 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. > > > > [[alternative HTML version deleted]] > > > > > > > > > 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. > > > > > _______________________________________________ > R-help-es mailing list > R-help-es@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-help-es > > > > > > -- > > 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 [[alternative HTML version deleted]] _______________________________________________ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es