<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        mso-believe-normal-left:yes;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EstiloCorreo18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><![if mso 9]><style>p.MsoNormal
        {margin-left:7.5pt;}
</style><![endif]><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ES link="#0563C1" vlink="#954F72" style='margin-left:7.5pt;margin-top:7.5pt;margin-right:7.5pt;margin-bottom:7.5pt'><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Disculpen, A veces me falla el otro correo y lo reenvío por este<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>De:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> R-help-es [mailto:r-help-es-bounces@r-project.org] <b>En nombre de </b>jbetancourt<br><b>Enviado el:</b> sábado, 16 de enero de 2016 05:49<br><b>Para:</b> 'Lista R' <r-help-es@r-project.org><br><b>CC:</b> luisfo89 <luisfo89@yahoo.com><br><b>Asunto:</b> [R-es] fechas<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:10.0pt'> <o:p></o:p></span></p></div><div><div><p class=MsoNormal><span style='font-size:10.0pt'>Estimados<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>Muchas gracias por su ayuda. No he logrado convertir los datos de climas diarios a datos por semana, es decir<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'> que junto a la identificación de las semanas, quisiera que los datos climaticos de cada semana se reflejaran <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>en cada semana .Adjunto datos<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>Ejemplo<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>semana48  Max.TemperatureF Mean.TemperatureF Min.TemperatureF etc<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>Perdonen mis limitados conocimientos<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>LOS SCRIPT ENVIADOS FUNCIONARON PARA IDENTIFICAR LA SEMANA<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>#####################################<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>rm(list = ls()) <o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>#setwd("D:/Public/Documents/R/r_epidemiología/") <o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>datIn <- read.table("clima.csv", header=T, as.is=TRUE, sep=",")<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>datIn<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>library(lubridate)<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>#datIn$fecha <- mdy(datIn$CST)<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>datIn$semana <- week(datIn$fecha)<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>datIn$semana<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>##################################################<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>library("lubridate")<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>data <- read.csv("clima.csv", stringsAsFactors=F)<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'># mdy() para formato m/d/y. existe dmy() para formato d/m/y<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'>woy <- week(mdy(data$CST)) #week of year<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>woy<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>SEMANAS<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>1  1  1  1  1  1  1  2  2  2  2  2  2  2  3  3  3  3  3  3  3  4  4  4  4  4  4<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'> [28]  4  5  5  5  5  5  5  5  6  6  6  6  6  6  6  7  7  7  7  7  7  7  8  8  8  8  8<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'> [55]  8  8  9  9  9  9  9  9  9 10 10 10 10 10 10 10 11 11 11 11 11 11 11 12 12 12 12<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'> [82] 12 12 12 13 13 13 13 13 13 13 14 14 14 14 14 14 14 15 15 15 15 15 15 15 16 16 16<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[109] 16 16 16 16 17 17 17 17 17 17 17 18 18 18 18 18 18 18 19 19 19 19 19 19 19 20 20<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[136] 20 20 20 20 20 21 21 21 21 21 21 21 22 22 22 22 22 22 22 23 23 23 23 23 23 23 24<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[163] 24 24 24 24 24 24 25 25 25 25 25 25 25 26 26 26 26 26 26 26 27 27 27 27 27 27 27<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[190] 28 28 28 28 28 28 28 29 29 29 29 29 29 29 30 30 30 30 30 30 30 31 31 31 31 31 31<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[217] 31 32 32 32 32 32 32 32 33 33 33 33 33 33 33 34 34 34 34 34 34 34 35 35 35 35 35<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[244] 35 35 36 36 36 36 36 36 36 37 37 37 37 37 37 37 38 38 38 38 38 38 38 39 39 39 39<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[271] 39 39 39 40 40 40 40 40 40 40 41 41 41 41 41 41 41 42 42 42 42 42 42 42 43 43 43<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[298] 43 43 43 43 44 44 44 44 44 44 44 45 45 45 45 45 45 45 46 46 46 46 46 46 46 47 47<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[325] 47 47 47 47 47 48 48 48 48 48 48 48 49 49 49 49 49 49 49 50 50 50 50 50 50 50 51<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>[352] 51 51 51 51 51 51 52 52 52 52 52 52 52 53<o:p></o:p></span></p></div></div></div></body></html>