Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require(gdata)
- require(xlsx)
- n = c(2, 3, 5)
- s = c("aa", "bb", "cc")
- b = c(TRUE, FALSE, TRUE)
- df = data.frame(n, s, b) # df is a data frame
- write.xlsx(df, "file3.xlsx")
- #read file and make changes
- mydata = read.xls("file3.xlsx")
- mydata[2,2] <- mydata[2,2]+1 #in column n (with 2, 3, 5 as values) we will increase the value of 3
- write.xlsx(df, "file3.xlsx", row.names=FALSE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement