Displaying 19 results from an estimated 19 matches for "readworksheetfromfile".
2013 May 02
1
Problems with reading data by readWorksheetFromFile of XLConnect Package
...mbers. Even if I copy and paste as numbers to form a new
file "130502temp_number1.xlsx", they could not be read smoothly.
1. How can I read the datasheet as numbers?
2. How can I treat the notation "-" as (1) "NA" or (2) zero?
Thanks,
Miao
> temp<-readWorksheetFromFile("130502temp.xlsx", sheet=1, header=FALSE,
startRow=2, endRow= 11, startCol=2, endCol=5)
> temp
Col1 Col2 Col3 Col4
1 647,853 1,413 57,662 27,897
2 491,400 1,365 40,919 20,411
3 38,604 - 5,505 985
4 576 - 20 54
5 80,845 21 10,211 4,49...
2017 Sep 23
2
"XLConnect" packages; Excel dates read incorrectly
...uot;2004-01-01" (Th)
"2004-01-04" (Su)
"2004-01-05" (M)
"2004-01-06" (Tu)
"2004-01-07" (W)
"2004-01-08" (Th)
The codes are (also attached):
rm(list=ls())
library(XLConnect)
library(xlsx)
fl<-paste("allData_out3.xlsx")
a1<-readWorksheetFromFile(fl, sheet="first", colTypes="numeric")
b1<-readWorksheetFromFile(fl, sheet="second", colTypes="numeric")
a_col<-readWorksheetFromFile(fl, sheet="first")
date11<-as.Date(a_col$date, format="%Y-%m-%d")
The output:
> date11
[1]...
2017 Sep 23
0
"XLConnect" packages; Excel dates read incorrectly
...5" (M)
> "2004-01-06" (Tu)
> "2004-01-07" (W)
> "2004-01-08" (Th)
>
>
>
> The codes are (also attached):
>
>
> rm(list=ls())
> library(XLConnect)
> library(xlsx)
>
> fl<-paste("allData_out3.xlsx")
> a1<-readWorksheetFromFile(fl, sheet="first", colTypes="numeric")
> b1<-readWorksheetFromFile(fl, sheet="second", colTypes="numeric")
> a_col<-readWorksheetFromFile(fl, sheet="first")
> date11<-as.Date(a_col$date, format="%Y-%m-%d")
>
>
>...
2017 Sep 23
2
"XLConnect" packages; Excel dates read incorrectly
...7" (W)
> > "2004-01-08" (Th)
> >
> >
> >
> > The codes are (also attached):
> >
> >
> > rm(list=ls())
> > library(XLConnect)
> > library(xlsx)
> >
> > fl<-paste("allData_out3.xlsx")
> > a1<-readWorksheetFromFile(fl, sheet="first", colTypes="numeric")
> > b1<-readWorksheetFromFile(fl, sheet="second", colTypes="numeric")
> > a_col<-readWorksheetFromFile(fl, sheet="first")
> > date11<-as.Date(a_col$date, format="%Y-%m-%d")...
2017 Sep 24
3
"XLConnect" packages; Excel dates read incorrectly
...>>
> >>> The codes are (also attached):
> >>>
> >>>
> >>> rm(list=ls())
> >>> library(XLConnect)
> >>> library(xlsx)
> >>>
> >>> fl<-paste("allData_out3.xlsx")
> >>> a1<-readWorksheetFromFile(fl, sheet="first", colTypes="numeric")
> >>> b1<-readWorksheetFromFile(fl, sheet="second", colTypes="numeric")
> >>> a_col<-readWorksheetFromFile(fl, sheet="first")
> >>> date11<-as.Date(a_col$date, forma...
2017 Sep 24
0
"XLConnect" packages; Excel dates read incorrectly
...ot; (Th)
>>>
>>>
>>>
>>> The codes are (also attached):
>>>
>>>
>>> rm(list=ls())
>>> library(XLConnect)
>>> library(xlsx)
>>>
>>> fl<-paste("allData_out3.xlsx")
>>> a1<-readWorksheetFromFile(fl, sheet="first", colTypes="numeric")
>>> b1<-readWorksheetFromFile(fl, sheet="second", colTypes="numeric")
>>> a_col<-readWorksheetFromFile(fl, sheet="first")
>>> date11<-as.Date(a_col$date, format="%Y-%m-%...
2017 Sep 24
0
"XLConnect" packages; Excel dates read incorrectly
...odes are (also attached):
>> >>>
>> >>>
>> >>> rm(list=ls())
>> >>> library(XLConnect)
>> >>> library(xlsx)
>> >>>
>> >>> fl<-paste("allData_out3.xlsx")
>> >>> a1<-readWorksheetFromFile(fl, sheet="first", colTypes="numeric")
>> >>> b1<-readWorksheetFromFile(fl, sheet="second", colTypes="numeric")
>> >>> a_col<-readWorksheetFromFile(fl, sheet="first")
>> >>> date11<-as.Date(a_col...
2016 Nov 17
2
problem with normalizePath()
...rk drive
df1 <- read_excel("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls")
# pathname is fully qualified, but error thrown as above
cat(normalizePath("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls"))
# throws same error
# reading same file with different function
df2 <- readWorksheetFromFile("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls", 1)
# completes successfully
# reading same file from local drive
df3 <- read_excel("C:/17.xls")
# completes successfully
sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Wind...
2016 Apr 23
1
Java memory error when reading a small xlsx file
Hi,
I tried to read a (small) xlsx file by "readWorksheetFromFile" function
of "XLConnect" package and "read.xlsx" function in "xlsx" package, but I
got this error message:
Error: OutOfMemoryError (Java): Java heap space
I tried to follow the solution on the web
http://stackoverflow.com/questions/21937640/handling-java-lang...
2013 Jul 22
1
problem loading large xlsx file into r
Hi,
I am facing trouble when trying to read large xlsx file into R. please find the code and error below. The file I was trying to read has 36,500 rows X 188 col, ~ 37 MB size.
> options( java.parameters = "-Xmx4g" )
> library(xlsx)
Loading required package: xlsxjars
Loading required package: rJava
> cftc =
2016 Nov 18
2
problem with normalizePath()
...>> # pathname is fully qualified, but error thrown as above
>>
>> cat(normalizePath("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls"))
>> # throws same error
>>
>> # reading same file with different function df2 <-
>> readWorksheetFromFile("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls",
>> 1) # completes successfully
>>
>> # reading same file from local drive df3 <-
>> read_excel("C:/17.xls") # completes successfully
>>
>> sessionInfo() R version 3....
2012 Jan 10
3
unir en .dbf luego de aplicar read.xls a varios archivos
Estimados:
Tengo un directorio con varios archivos Excel quiero importarlos todos
y grabarlos en un único archivo .dbf.
Haciendolo uno por uno lo logro de la siguiente manera (solo tomo 2 archivos):
archivos <- list.files(pattern = 'xls')
a1 <- read.xls(archivos[1],
perl="C:\\strawberry\\perl\\bin\\perl.exe",skip=12,dec=",",header=F,as.is=T)
a2 <-
2015 Nov 12
3
Problema con la lectura de datos
Otra opción es importar directamente los datos que necesites usando
XLConnect (sin llevarlos a CSV).
Ese paquete permite hacer cosas muy potentes desde el propio fichero de
Excel.
https://cran.r-project.org/web/packages/XLConnect/index.html
Recomiendo, encarecidamente, la lectura de sus dos vignettes.
Un Saludo,
--
Miguel Ángel Rodríguez Muíños
Dirección Xeral de Saúde Pública
Consellería de
2016 Nov 30
1
problem with normalizePath()
...ly qualified, but error thrown as above
> >>
> >> cat(normalizePath("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls"))
> >> # throws same error
> >>
> >> # reading same file with different function df2 <-
> >> readWorksheetFromFile("//Hzndhhsvf2/data/OCPH/EPI/
> BHSDM/Group/17.xls",
> >> 1) # completes successfully
> >>
> >> # reading same file from local drive df3 <-
> >> read_excel("C:/17.xls") # completes successfully
> >>
> &...
2016 Nov 17
0
problem with normalizePath()
...ot;//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls")
> # pathname is fully qualified, but error thrown as above
>
> cat(normalizePath("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls"))
> # throws same error
>
> # reading same file with different function
> df2 <- readWorksheetFromFile("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls",
> 1)
> # completes successfully
>
> # reading same file from local drive
> df3 <- read_excel("C:/17.xls")
> # completes successfully
>
> sessionInfo()
> R version 3.3.2 (2016-10-31)
> Platform: x86...
2013 Jun 20
0
how to run copula-based quantile regression
...he documentation of "copula" and "copBasic". However, I still
have difficulty to deal with my data.
Details are as following:
I've already loaded xls data into r using "XLConnect" package.
excel.file<-file.path("Q:/dailyvstoxx.xls")
dailyvstoxx<-readWorksheetFromFile(excel.file, sheet=1)
Then, I've loaded "copBasic"package.
According to the example 'qua.regressCOP' in the documentation "copBasic":
theta <- 10
R <- qua.regressCOP(cop=PLACKETTcop, para=c(theta))
I have two questions:
1) how to solve out the 'theta&...
2016 Nov 30
0
problem with normalizePath()
...>> # pathname is fully qualified, but error thrown as above
>>
>> cat(normalizePath("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls"))
>> # throws same error
>>
>> # reading same file with different function df2 <-
>> readWorksheetFromFile("//Hzndhhsvf2/data/OCPH/EPI/BHSDM/Group/17.xls",
>> 1) # completes successfully
>>
>> # reading same file from local drive df3 <-
>> read_excel("C:/17.xls") # completes successfully
>>
>> sessionInfo() R version 3....
2012 Aug 17
4
Appending many different and separate Excel files using R
Dear all,
Good day!
I have a problem in reading Excel files in R and appending them to each other. Suppose we have several Excel files in a directory with headers and want to use R to append them in a single file with an additional variable in the final file indicating from which files the data come from.
As I have many Excel files and their sizes are very big I should write a loop in R to do
2012 Sep 18
0
Appending many different and separate Excel files using R
...gt; require(XLConnect)
>>
>> fpattern <- "Book.*.xls?" # pattern for filenames
>> output.file <- "Test.xls"
>> lfiles <- list.files(pattern = fpattern)
>>
>> # Read first worksheet from each file
>> data.lst <-lapply(lfiles, readWorksheetFromFile, sheet = 1)
>>
>> # Get column names from data.frames
>> data.names <- lapply(data.lst, names)
>>
>> # Create a result data.frame, we are going
>> # to put everything here
>> result <- data.frame(Book = 1, data.lst[[1]])
>>
>> # Work varia...