[R-es] problemas con rBIND con distintos número de columnas

Carlos Ortega cof en qualityexcellence.es
Mar Feb 14 18:20:38 CET 2017


Hola Javier,

Mientras que el "rbind()" que proporciona el paquete "base" en este caso te
dará un error.
El "rbind" que proporciona el paquete "data.table", creo que no lo da...

Siempre puedes rellenar esos huecos con NAs en el data.frame al que le
falte antes de juntarlas... y evitarte el trastorno.

Saludos,
Carlos Ortega
www.qualityexcellence.es

El 14 de febrero de 2017, 16:15, Javier Valdes Cantallopts (DGA) <
javier.valdes en mop.gov.cl> escribió:

> Hola a todos:
>
> Necesito pegar 4 bases de datos de N variables y N columnas, EL PROBLEMA
> ES QUE 3 *CONSTAN DE 13 COLUMNAS*, y LA CUARTA CON *11 COLUMNAS*.
>
> He *usado rbind y smartbind*, sin embargo el resultado no es el esperado,
> ya que coloca las columnas a un costado y no hacia abajo como debería
>
> Como resultado necesito algo como LO QUE PRESENTO ABAJO, * RELLENANDO LOS
> ESPACIOS VACIOS CON “NA”*
>
>
>
> 30/03/15 7:00
>
> 38
>
> 13.28
>
> 275.4431
>
> -1.667118
>
> 638.5
>
> -1.459
>
> 3.08
>
> 175.5
>
> -130
>
> -64.52
>
> *Na*
>
> *Na*
>
> 30/03/15 8:00
>
> 39
>
> 13.27
>
> 273.3796
>
> -0.9093614
>
> 638.5
>
> -1.386
>
> 4.099
>
> 151.6
>
> -129.9
>
> -64.42
>
> *Na*
>
> *Na*
>
> 30/03/15 9:00
>
> 40
>
> 13.21
>
> 275.5319
>
> 19.8293
>
> 638.6
>
> -1.39
>
> 3.573
>
> 138.7
>
> -129.8
>
> -64.34
>
> *Na*
>
> *Na*
>
> 30/03/15 10:00
>
> 41
>
> 13.25
>
> 278.6717
>
> 69.58882
>
> 638.8
>
> -1.227
>
> 4.193
>
> 174.4
>
> -129.8
>
> -64.3
>
> *Na*
>
> *Na*
>
> 30/03/15 11:00
>
> 42
>
> 13.59
>
> 276.256
>
> 153.4836
>
> 638.9
>
> -0.888
>
> 4.291
>
> 39.6
>
> -129.8
>
> -64.35
>
> *Na*
>
> *Na*
>
> 30/03/15 12:00
>
> 43
>
> 14.71
>
> 276.9799
>
> 233.9256
>
> 639
>
> -0.587
>
> 3.561
>
> 133.1
>
> -129.9
>
> -64.44
>
> *Na*
>
> *Na*
>
> 30/03/15 13:00
>
> 44
>
> 14.56
>
> 265.1613
>
> 449.0849
>
> 639.3
>
> -0.011
>
> 3.624
>
> 180.1
>
> -130
>
> -64.53
>
> *Na*
>
> *Na*
>
> 30/03/15 14:00
>
> 45
>
> 14.51
>
> 268.376
>
> 418.3066
>
> 639.6
>
> 0.2
>
> 3.885
>
> 138.3
>
> -130.3
>
> -64.82
>
> *Na*
>
> *Na*
>
> 28/03/15 16:40
>
> 0
>
> 12.96
>
> 0
>
> 168.4
>
> -28.4
>
> 13.01
>
> 697.9466
>
> 5.268066
>
> 278.4181
>
> -111.8081
>
> 228.8923
>
> 620.3669
>
> 28/03/15 16:50
>
> 1
>
> 12.99
>
> 3.473
>
> 248.3
>
> -33.81
>
> 8.52
>
> 644.0493
>
> 5.009216
>
> 278.1592
>
> -110.2677
>
> 229.1674
>
> 590.3563
>
> 28/03/15 17:00
>
> 2
>
> 12.99
>
> 3.917
>
> 174.7
>
> -38.64
>
> 4.529
>
> 644.2397
>
> 4.819122
>
> 277.9691
>
> -111.376
>
> 227.1322
>
> 556.6758
>
>
>
> SALUDOS.
>
>
>
>
>
>
>
>
>
>
>
>
>
> [image: Descripción: FIRMA2]
>
>
>
> ------------------------------
>
> 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/20170214/21da184c/attachment-0001.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7089 bytes
Desc: no disponible
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20170214/21da184c/attachment-0001.png>


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