Displaying 16 results from an estimated 16 matches for "xlsfile".
2009 Aug 18
2
(no subject)
...examples:
First, I try to read my data, which does not work;
Secondly, I tried the example code/data with the Iris data, which worked
Any idea?
Thanks,
Lars
> path<-"I:/subProjects/bh/HPGD/"
>
> setwd(path)
>
> xls <- "Platten_Liste_090421.xls"
>
> xlsfile <- file.path(path,xls)
>
> file.exists(xlsfile)
[1] TRUE
>
>
>
> oxl <- comCreateObject("Excel.Application")
>
> comSetProperty(oxl, "Visible", TRUE)
NULL
>
> owb <- comGetProperty(oxl, "Workbooks")
>
> ob <- comInvoke(ow...
2010 Jun 16
2
Reading data from xls..........please help
Can anyone help me how to read xls file into R. I have tried following
library(gdata)
xlsfile <- file.path(.path.package('gdata'),'xls','iris.xls')
read.xls(xlsfile)
I got following error:
Converting xls file to csv file... Error in system(cmd, intern = !verbose) :
perl not found
Error in file.exists(tfn) : invalid 'file' argument
Question *1) What is th...
2012 May 20
4
write.xls
...se, please install the missing modules. See the package INSTALL
file for more information.
# *** NOTE: I may be able to fix this for myself.
# *** However, I want to use this in the 'sos' package,
# *** and if it doesn't work easily for me, it may not work for others.
library(RODBC)
xlsFile <- odbcConnectExcel(outFile, readOnly=FALSE)
# NOTE: This works with R 2.15.0 32-bit.
# However, with 64-bit, I get the following error message here:
# Error in odbcConnectExcel(outFile, readOnly = FALSE) :
# odbcConnectExcel is only usable with 32-bit Windows
# When this works, the followin...
2014 Aug 14
3
leer ficheros excel en R en Ubuntu
...# 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.x...
2010 Jul 22
1
64 bit use of odbcConnectExcel
...uter
(> 4 gig) and for files with millions of rows this is useful but it seems it
is still under development. For now I switch back an forth between 64 bit
and 32 bit depending on what I'm working on.
Any suggested solutions for xls import problems?
My function
get.xls.file <- function(xlsfile){
library(RODBC)
#xlsfile <- file.choose()
channel1 <- odbcConnectExcel(xlsfile)
a <- sqlTables(channel1)
b <- nchar(a$TABLE_NAME[1])
x <- substring(a$TABLE_NAME[1], 2, b-2)
data <- sqlFetch(channel1, x, max=1001)
odbcCloseAll()
return(data)
}
JT
--
View this message in context...
2010 Feb 24
1
problem with sqlSave()
...42063, 61.4088750589742, 82.8579246229594,
86.904905246028, 58.9562752558462, 58.5971747302359, 78.4453136851244)),
.Names = c("Group", "Group", "test", "crit", "se", "df"), row.names =
c(NA, -15L), class = "data.frame")
> xlsFile <- odbcConnectExcel("output.xls", readOnly=F) ##the file
is created here, it didn't exist before here
> sqlSave(xlsFile, test, tablename="test1", rownames=F, addPK=T, append=T)
Error in sqlSave(xlsFile, test, tablename = "test1", rownames = F, addPK
= T...
2010 Feb 23
1
RODBC to import/export xls files
..."cdeg")?
The thing is that I almost always have a single sheet in my xls files,
which is not really named (usually sheet1, sheet2, etc), so it would be
great if I could just import the 1st sheet into the dataframe.
- to export I do this (from Tal Galili's solution earlier today):
xlsFile <- odbcConnectExcel("file", readOnly=F)
save2excel <- function(x, t.name) sqlSave(xlsFile, x, tablename=t.name,
rownames=F, addPK=T)
odbcCloseAll()
It also works great, but how can I append lines? This function allows me
to append new sheets in the file, but I would also like to a...
2014 Aug 15
5
leer ficheros excel en R en Ubuntu
...w 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")
>...
2010 Feb 24
1
problem with looping on sqlSave()
...9.47791, 24.585605,
NA, NA, NA, NA, NA, NA, NA), .Dim = c(11L, 3L), .Dimnames = list(
NULL, c("qhat", "lower", "upper"))), crit = 0.611274541966673,
numsig = 0L, pc = NA), .Names = c("m", "crit", "numsig",
"pc"))
> xlsFile <- odbcConnectExcel("file.xls", readOnly=F)
> for (i in 1:4){
sqlSave(xlsFile, as.data.frame(test[[i]]), tablename="test", rownames=F,
addPK=T, append=T)
}
Error in odbcUpdate(channel, query, mydata, coldata[m, ], test = test,
: missing columns in 'data'
>...
2014 Aug 15
2
leer ficheros excel en R en Ubuntu
...uot;) # 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....
2014 Aug 15
2
leer ficheros excel en R en Ubuntu
...ery(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)
>...
2010 Jan 18
1
Exporting a data.frame to excel using sqlSave - adds a character ' to values
...into one excel file with
multiple sheets.
One thing I can't seem to unserdatand is way the command adds the character:
'
To the beginning of each of my (non numeric) values.
Here is an example code:
library(RODBC)
library(MASS)
data(anorexia)
save2excel <- function(x, t.name) sqlSave(xlsFile, x, tablename = t.name,
rownames = FALSE)
xlsFile <- odbcConnectExcel("C:\\output-table.xls", readOnly = FALSE)
save2excel(anorexia, "temp")
odbcCloseAll()
So the output file has
*'*Treat
instead of:
Treat
In cell - A1
Thanks,
Tal
----------------Contact
Details...
2006 Oct 25
0
gtools(read.xls) error in perl installation?
...quot;
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Unable to open file '~/Desktop/2006_ICN_subjects.xls'.
######################
On the other hand, if I use the example in the help file...
######################
> xlsfile <- file.path(.path.package('gdata'),'xls','iris.xls')
> read.xls(xlsfile)
perl: warning: Setting locale failed.
Sepal.Length Sepal.Width Petal.Length Petal.Width
Species X
1 1 5.1 3.5 1.4 0.2 setosa
2...
2010 Apr 29
1
UpdateLinks = FALSE
...I tried more variations, but one attempt is shown below).
How can I suppress such messages?
excel <- comCreateObject("Excel.Application")
wb <- comGetProperty(excel, "Workbooks")
comSetProperty(wb, "UpdateLinks", FALSE)
owb <- comInvoke(wb, "Open", xlsfile) # at this point, it's too late
Another query: the program at large erases any cells that contain formulae. Thanks to Erich, the program now works like a charm. However, some cells contain formulae such as "832.1 * E4 * E3" (yes I know: big, big *sigh*). I did not take that possibil...
2009 Nov 16
5
Writing a data frame in an excel file
Hello, I am having trouble by using the write.table function to write a data
frame of 4 columns and 7530 rows. I don?t know if I should just use a
sep="\n" and change the .xls file into a .csv file. Thanks in advance
-----
Anna Lippel
new in R so be careful I should be asking a loooooooot of questions!:teeth:
--
View this message in context:
2007 Jul 08
1
Writing Excel (.xls) files on non-Windows OSs using Perl
...line arguments
my $CSVPath = '.';
my $CSVFiles = "*.csv";
GetOptions ('CSVpath=s' => \$CSVPath,
'CSVfiles=s' => \$CSVFiles);
my $ExcelFileName = $ARGV[0];
# Create Excel XLS File
print "Creating Excel File: $ExcelFileName\n\n";
my $XLSFile = Spreadsheet::WriteExcel::Big->new($ExcelFileName);
# Glob file path and names
my @FileNames = <$CSVPath/$CSVFiles>;
foreach my $FileName (@FileNames) {
print "Reading: $FileName\n";
# Open CSV File
my $csv = Text::CSV_XS->new();
open (CSVFILE, "$FileName&q...