Answers for "open xlsx with r"

R
1

read xlsx in r

 
require(xlsx)
read.xlsx("myfile.xlsx", sheetName = "Sheet1")
read.xlsx2("myfile.xlsx", sheetName = "Sheet1")
Posted by: Guest on July-19-2020
0

read xlsx in r

 
require(gdata)
df = read.xls ("myfile.xlsx"), sheet = 1, header = TRUE)
Posted by: Guest on July-19-2020
0

read xlsx in r

 
require(xlsx)
coln = function(x) { # A function to see column numbers
  y = rbind(seq(1, ncol(x)))
  colnames(y) = colnames(x)
  rownames(y) = "col.number"
  return(y)
}
data = read.xlsx2("myfile.xlsx", 1) # open the file 
coln(data) # check the column numbers you want to have as factors
x = 3 # Say you want columns 1-3 as factors, the rest numeric
data = read.xlsx2("myfile.xlsx", 1, 
  colClasses = c(rep("character", x), rep("numeric", ncol(data)-x+1))
)
Posted by: Guest on July-19-2020
0

open xlsx with r

my_data <- read.table(file = "clipboard", 
                      sep = "\t", header=TRUE)
Posted by: Guest on March-28-2021

Browse Popular Code Answers by Language