Grokbase Groups R r-help January 2016
FAQ
Take a look at the data coming in since you may have something that looks
like characters (maybe 'blanks'). What you think is numeric in EXCEL might
not be.?




Jim Holtman
Data Munger Guru


What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.


On Thu, Jan 14, 2016 at 11:20 AM, Mohsen Jafarikia wrote:

Hello:

I am reading some excel files (each with one sheet) and trying to write
them all in one file. I am not sure if read.xlsx reads some of the columns
as character or write.xlsx writes them as character where they are not
characters. I have 12 columns (2 character and 10 numbers). From 10 number
columns, with float and integer numbers, only 3 of them are recognized
correctly. I was wondering how can I define the the column format for
read.xlsx - write.xlsx.

Here comes a simple example of my code:

ifn1 <- "A.xlsx"
dat1 <- read.xlsx(ifn1, sheetName="A.csv", header = TRUE)

ifn2 <- "F.xlsx"
dat2 <- read.xlsx(ifn2, sheetName="F.csv",header = TRUE)

write.xlsx(dat1, file="AF.xlsx", sheetName="A", showNAúLSE,
row.namesúLSE, appendúLSE)
write.xlsx(dat2, file="AF.xlsx", sheetName="F", showNAúLSE,
row.namesúLSE, append= TRUE)

Thanks in advance!
Mohsen

[[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

  [[alternative HTML version deleted]]

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 7 | next ›
Discussion Overview
groupr-help @
categoriesr
postedJan 14, '16 at 4:20p
activeJan 14, '16 at 7:51p
posts7
users2
websiter-project.org
irc#r

2 users in discussion

Mohsen Jafarikia: 4 posts Jim holtman: 3 posts

People

Translate

site design / logo © 2018 Grokbase