De nada, Miguel. Es posible que me envies el archivo offline? --JIV
2014-08-15 17:45 GMT+10:00 Miguel Fiandor Guti�rrez < miguel.fiandor.gutier...@gmail.com>: > Gracias Jorge por contestar tan r�pido. > > Con gdata hago eso del path, y directamente con el fichero, lo vi en una > web, y he intentado todas las opcioens que he visto. > > En vez de install.packages('rJava', type = 'source') > he hecho install.packages('rJava') > > Ahora probar�, y lo mismo con scan y readLines. > > > He visto en stackoverflow que mi problema puede ser actualizar java, u > openjava m�s bien -> > http://stackoverflow.com/questions/16438073/unable-to-install-rjava-in-r-3-0-in-ubuntu-13-04 > > Luego os cuento > > Gracias de nuevo > > > > El 15 de agosto de 2014, 9:38, Jorge I Velez <jorgeivanve...@gmail.com> > escribi�: > > Hola Miguel, >> >> Me queda claro lo de RODBC. Lo que no entiendo muy bien es por que usas >> >> file.path(path.package('gdata'),'xls','madrid.xls') >> >> cuando usas gdata. Tus datos estan en la carpeta donde se encuentra en >> paquete? O estan en otro lugar? Comenzaria revisando el path al archivo y >> escribiendo >> >> datos <- read.xls("/path/al/archivo/madrid.xls", sheet = 1, header = TRUE) >> head(datos) >> >> Que version de R tienes? Has intentado reinstalando rJava desde >> sources()? >> >> install.packages('rJava', type = 'source') >> require('rJava') >> require('xlsx') >> >> Las otras opciones, como mencione en mi mensaje anterior, es usar scan() >> y readLines(). >> >> Saludos, >> Jorge.- >> >> >> >> 2014-08-15 17:29 GMT+10:00 Miguel Fiandor Guti�rrez < >> miguel.fiandor.gutier...@gmail.com>: >> >> Hola, >>> >>> @javier, me gustar�a no tener que hacer nada de forma manual, ni por >>> fuera de r, rstudio. Es decir, el t�pico comando de linux que me convierta >>> de xls a csv prefiero no usarlo. Me gustar�a hacerlo todo desde R. >>> >>> @jorge -> >>> >>> Con RODBC me salta -> >>> >>> Error: could not find function "odbcConnectExcel" >>> >>> Lo que creo que es inevitable en Ubuntu >>> <http://stackoverflow.com/questions/3426523/odbcconnectexcel-function-from-rodbc-package-for-r-not-found-on-ubuntu> >>> Con gdata -> >>> >>> Unable to open file >>> '/home/miguelfg/R/x86_64-pc-linux-gnu-library/3.1/gdata/xls/madrid.xls'.Error >>> in xls2sep(xls, sheet, verbose = verbose, ..., method = method, : >>> Intermediate file '/tmp/RtmpHRuknw/filefed757fcc67.csv' missing!In >>> addition: Warning message:running command ''/usr/bin/perl' >>> >>> Con XLConnect -> >>> >>> Error : package 'rJava' was built before R 3.0.0: please re-install >>> itERROR: lazy loading failed for package 'XLConnectJars'* removing >>> '/home/miguelfg/R/x86_64-pc-linux-gnu-library/3.1/XLConnectJars'Warning in >>> install.packages : >>> installation of package 'XLConnectJars' had non-zero exit statusERROR: >>> dependency 'XLConnectJars' is not available for package 'XLConnect'* >>> removing >>> '/home/miguelfg/R/x86_64-pc-linux-gnu-library/3.1/XLConnect'Warning in >>> install.packages : >>> installation of package 'XLConnect' had non-zero exit status >>> >>> Con xlsReadWrite -> me dice que no est� disponible para R 3.1.1 Con xlsx >>> -> >>> >>> Error : package 'rJava' was built before R 3.0.0: please re-install >>> itERROR: lazy loading failed for package 'xlsxjars'* removing >>> '/home/miguelfg/R/x86_64-pc-linux-gnu-library/3.1/xlsxjars'Warning in >>> install.packages : >>> installation of package 'xlsxjars' had non-zero exit statusERROR: >>> dependency 'xlsxjars' is not available for package 'xlsx'* removing >>> '/home/miguelfg/R/x86_64-pc-linux-gnu-library/3.1/xlsx'Warning in >>> install.packages : >>> installation of package 'xlsx' had non-zero exit status >>> >>> ================================= Viendo que el problema parec�a java + >>> rJava, busqu� y ejecut� -> sudo R CMD javareconf -e Pero parece que no >>> termina bien -> conftest.c:1:17: fatal error: jni.h: No such file or >>> directory compilation terminated. make: *** [conftest.o] Error 1 Unable to >>> compile a JNI program >>> >>> >>> El 15 de agosto de 2014, 2:23, Jorge I Velez <jorgeivanve...@gmail.com> >>> escribi�: >>> >>> Hola Miguel, >>>> >>>> A que te refieres con "y nada"? Obtienes algun error? Algun mensaje? >>>> Has probado con scan() y/o readLines()? >>>> >>>> Saludos, >>>> Jorge.- >>>> >>>> >>>> >>>> 2014-08-15 7:38 GMT+10:00 Miguel Fiandor Guti�rrez < >>>> miguel.fiandor.gutier...@gmail.com>: >>>> >>>>> Hola, >>>>> >>>>> Pens� que esto iba a ser trivial en R, pero me estoy encontrado muchos >>>>> con >>>>> mi problema en internet, y que las soluciones ofrecidas no terminan de >>>>> funcionar. >>>>> >>>>> Estoy intentando leer un fichero .xls en ubuntu con los siguientes >>>>> paquetes >>>>> y nada: >>>>> >>>>> require(RODBC) >>>>> conn = odbcConnectExcel("madrid.xls") # open a connection to the Excel >>>>> file >>>>> sqlTables(conn)$TABLE_NAME # show all sheets >>>>> df = sqlFetch(conn, "Sheet1") # read a sheet >>>>> df = sqlQuery(conn, "select * from [Sheet1 $]") # read a sheet >>>>> (alternative >>>>> SQL sintax) >>>>> close(conn) # close the connection to the file >>>>> >>>>> require(gdata) >>>>> xlsfile <- file.path(path.package('gdata'),'xls','madrid.xls') >>>>> df = read.xls (xlsfile) >>>>> df = read.xls (xlsfile, sheet = 1, header = TRUE) >>>>> df = read.xls ("madrid.xls", sheet = 1, header = TRUE) >>>>> df = read.xls ("madrid.xls") >>>>> >>>>> require(xlsx) >>>>> read.xlsx("madrid.xls", sheetName = "Sheet1") >>>>> >>>>> library(XLConnect) >>>>> wk = loadWorkbook("madrid.xls") >>>>> df = readWorksheet(wk, sheet="Sheet1") >>>>> >>>>> -- >>>>> >>>>> tambi�n he probado directamente read.table ya que el fichero es tipo >>>>> xml >>>>> por dentro: >>>>> df = read.table("madrid.xls", header = TRUE) >>>>> >>>>> >>>>> -- ejemplo del fichero: >>>>> $ head -c 500 madrid.xls >>>>> <table border="1"><tr><th bgcolor="#FFB18C">Nombre de la >>>>> instalacion</th><th bgcolor="#FFB18C">Municipio de la >>>>> instalacion</th><th >>>>> bgcolor="#FFB18C">Provincia de la instalacion</th><th >>>>> bgcolor="#FFB18C">Clave del registro</th><th bgcolor="#FFB18C">Codigo >>>>> registro autonomico definitivo</th><th bgcolor="#FFB18C">Potencia >>>>> nominal >>>>> de la fase (kW)</th><th bgcolor="#FFB18C">Grupo Normativo</th><th >>>>> bgcolor="#FFB18C">Tipo de Inscripcion</th></tr><tr><td>PERGOLA >>>>> FOTOVOLTAICA >>>>> JARDINES COMPLEJO DE MONCLOA >>>>> ... >>>>> >>>>> >>>>> Gracias de antemano. >>>>> >>>>> Por cierto, aprovecho que lanzo la pregunta es para una aplicaci�n >>>>> Shiny, >>>>> alguna recomendaci�n de como leer esta info solo una vez al arrancar el >>>>> servidor? >>>>> >>>>> >>>>> Miguel >>>>> >>>>> [[alternative HTML version deleted]] >>>>> >>>>> _______________________________________________ >>>>> R-help-es mailing list >>>>> R-help-es@r-project.org >>>>> https://stat.ethz.ch/mailman/listinfo/r-help-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