<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=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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:11.0pt;
        font-family:"Calibri",sans-serif;}
p
        {mso-style-priority:99;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=ES><div class=WordSection1><p><span lang=ES-AR>Estimado Valentina Aguilera<o:p></o:p></span></p><p><span lang=ES-AR><o:p> </o:p></span></p><p><span lang=ES-AR>Prueba algo como:<o:p></o:p></span></p><p><span lang=ES-AR>b$Edad <- as.vector(b$Edad)<o:p></o:p></span></p><p><span lang=ES-AR>o<o:p></o:p></span></p><p><span lang=ES-AR>b$Edad <- as.numeric(b$Edad)<o:p></o:p></span></p><p><span lang=ES-AR><o:p> </o:p></span></p><p><span lang=ES-AR>Claro, por cada variable que debas convertir. Yo para saber cuales escribo str(mi data frame).<o:p></o:p></span></p><p><span lang=ES-AR><o:p> </o:p></span></p><p><span lang=ES-AR>Uno de los dos tendría que funcionar</span></p><p><o:p> </o:p></p><p>Javier Rubén Marcuzzi<br>Técnico en Industrias Lácteas<br>Veterinario</p><p><o:p> </o:p></p><p><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p style='border:none;padding:0cm'><br><b>De: </b>Valentina Aguilera<br><b>Enviado: </b>martes, 10 de noviembre de 2015 16:56<br><b>Para: </b>Javier Rubén Marcuzzi;r help<br><b>Asunto: </b>RE: [R-es] Problema con la lectura de datos</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt'>con as.numeric tampoco me van los cálculos y no conozco otra manera, pues son alrededor de 40 variables las que tiene la tabla.</span><span style='font-size:12.0pt'><o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:12.0pt'><img width=708 height=1 id="Horizontal_x0020_Line_x0020_1" src="cid:image002.png@01D11BD9.81A6F1F0"></span><span style='font-size:12.0pt'><o:p></o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:12.0pt'>To: valeagui@outlook.es; cof@qualityexcellence.es; r-help-es@r-project.org<br>From: javier.ruben.marcuzzi@gmail.com<br>Subject: RE: [R-es] Problema con la lectura de datos<br>Date: Tue, 10 Nov 2015 16:43:05 -0300<o:p></o:p></span></p><div><p class=MsoNormal><span lang=ES-AR style='font-size:12.0pt'>Estimada Valentina</span><span style='font-size:12.0pt'><br></span><span lang=ES-AR style='font-size:12.0pt'> </span><span style='font-size:12.0pt'><br></span><span lang=ES-AR style='font-size:12.0pt'>as.numeric(...)</span><span style='font-size:12.0pt'><br></span><span lang=ES-AR style='font-size:12.0pt'> </span><span style='font-size:12.0pt'><br></span><span lang=ES-AR style='font-size:12.0pt'>Mira mi correo (de hace minutos) donde pregunto justo por eso, pero sobre un error.</span><span style='font-size:12.0pt'><br> <br> <br>Javier Rubén Marcuzzi<br>Técnico en Industrias Lácteas<br>Veterinario<br> <br> <o:p></o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><span style='font-size:12.0pt'><br><b>De: </b>Valentina Aguilera<br><b>Enviado: </b>martes, 10 de noviembre de 2015 16:40<br><b>Para: </b>Carlos Ortega;r help<br><b>Asunto: </b>Re: [R-es] Problema con la lectura de datos<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman",serif'> </span><span style='font-size:12.0pt'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Hola, sin indicar los tipos de variables si los lee, pero el problema est� en que necesito calcular una matriz de correlaciones y genera el siguiente error:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Error in cor(Variables) : 'x' must be numeric<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Date: Tue, 10 Nov 2015 20:35:40 +0100<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Subject: Re: [R-es] Problema con la lectura de datos<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>From: cof@qualityexcellence.es<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>To: valeagui@outlook.es<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>CC: r-help-es@r-project.org<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Hola,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Prueba a leer el fichero sin indicar los tipos de las variables.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Variables <- read.csv("C:/Users/usuario/Documents/variables2.csv", header=TRUE, sep=";", comment.char="" , strip.white=FALSE, dec = ",")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Saludos,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Carlos Ortega<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>www.qualityexcellence.es<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>El 10 de noviembre de 2015, 20:04, Valentina Aguilera <valeagui@outlook.es> escribi�:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Hola,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Estoy tratando de leer una base de datos: tengo 39 columnas, de las cuales 38 son variables y una es el nombre de las empresas. Por lo que escribo el siguiente codigo:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Variables <- read.csv("C:/Users/usuario/Documents/variables2.csv", header=TRUE, sep=";", comment.char="" ,                          colClasses=c(Empresas="character", rep("numeric",38)), strip.white=FALSE, dec = ",")<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Pero genera este error (y no se a que se deba, esto es, porque necesito calcular la matriz de correlaciones y me dice que los valores no son numericos):<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :   scan() expected 'a real', got 'ND'<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Gracias mil.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>        [[alternative HTML version deleted]]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>_______________________________________________<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>R-help-es mailing list<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>R-help-es@r-project.org<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>https://stat.ethz.ch/mailman/listinfo/r-help-es<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>-- <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Saludos,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>Carlos Ortega<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>www.qualityexcellence.es<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>                                                                               <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'>                [[alternative HTML version deleted]]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p></div></div><p class=MsoNormal><span style='font-size:12.0pt'> <o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>