user2270508
user2270508

Reputation: 33

Importing excel file into r with gdata, data shows as 'General'

library(gdata)
xls_data = read.xls("C:/folder/data_that_i_want.xlsx",
                     perl ="C:/Perl64/bin/perl.exe", 
                     sheet = "sheet_that_i_want")$column_name

When I then try to look at the data in r every field is simply "General" instead of the numeric data I was trying to get from excel.

Upvotes: 0

Views: 818

Answers (2)

user2270508
user2270508

Reputation: 33

The data was formatted as 'general' in excel, when I changed it to 'number' it imported into r just fine.

Upvotes: 1

mattbawn
mattbawn

Reputation: 1378

In the absence of more information have you tried the openxlsx library?

options(java.parameters="-Xmx2000m")

library(openxlsx)

data <- read.xlsx(excel.file, sheet = 1, startRow = 1, colNames = TRUE)

Upvotes: 0

Related Questions