Re: [R] write data using xlsReadWrite
Hi Ive come up with this code to read my file, but receive an error that I ve no idea how to fix. can some one help. > read<-read.xlsx("D:\\FYP\\image\\Cropped > Images\\user227\\user227forger.xlsx", sheetName="Sheet1", rowIndex="1", > colIndex="varLH2y", colClasses="character", row.names=TRUE) >Error in colIndex - 1 : non-numeric argument to binary operator here is an example of my data in .xlsx varLH2x varLH2y varHH2x varHH2y varLL2x varLL2yvarHL2x varHL2y 1 4967.552716 12278.95794 679.3101705 254.2841431 4480777.986 3792655.605 2149.541058 827.9458738 2 5629.682598 8439.341331 812.4770397 326.7078909 6257926.174 4259659.878 1959.730324 1396.045697 3 5358.412977 8522.830297 967.7044858 420.9888243 6189762.401 3684682.244 3483.700887 1293.746943 -- View this message in context: http://r.789695.n4.nabble.com/write-data-using-xlsReadWrite-tp4629825p4631019.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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.
Re: [R] write data using xlsReadWrite
Hai, I have change it to these, but error and I couldn't fix it. Do you have any idea why? file <- system.file("D:\\FYP\\image\\Cropped Images\\user61", "forgerUser61.xlsx", package = "xlsx") wb <- loadWorkbook("forgerUser61.xlsx") sheets <- getSheets(wb) sheet <- sheets[["all"]] res <- readRows(sheet, startRow=4, endRow=5, startColumn=2, endColumn=3) >Error in readRows(sheet, startRow = 4, endRow = 5, startColumn = 2, endColumn = 3) : >attempt to apply non-function -- View this message in context: http://r.789695.n4.nabble.com/write-data-using-xlsReadWrite-tp4629825p4630231.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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.
Re: [R] write data using xlsReadWrite
Hai, I use these codes to read my data from the above data that I create, but how can I get rid of the first V1, because it is row number, not one of my data value. Second, how can I read row 1 and only column 1 (V2 value for example). setwd("D:\\FYP\\image\\Cropped Images\\user61") info <-read.xlsx("forgerUser61.xlsx",sheetName="Sheet1",rowIndex=2:2,header=FALSE) > V1 V2 V3 V4 V5 > V6 V7 V8 V9 >1 1 1859.935 12068.61 281.5818 283.75 3330043 3495302 7557.209 > 1887.269 -- View this message in context: http://r.789695.n4.nabble.com/write-data-using-xlsReadWrite-tp4629825p4630209.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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.
Re: [R] write data using xlsReadWrite
Thank you, I came up with these. Problem solve. varValue <- data.frame(varLH2x, varLH2y, varHH2x, varHH2y, varLL2x, varLL2y, varHL2x, varHL2y) res<-write.xlsx(varValue, "D:\\FYP\\image\\Cropped Images\\user61\\genuineUser61temp.xlsx", sheetName="Sheet1",col.names=TRUE, row.names=TRUE, append=FALSE) -- View this message in context: http://r.789695.n4.nabble.com/write-data-using-xlsReadWrite-tp4629825p4630204.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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.
[R] write data using xlsReadWrite
Hai, I'm trying to write these var output data from these codes inside excel file. My directory to store the data is /D:\FYP\image / but receive an error message : /Error in write.xls(mydata, "D:\\FYP\\image.mydata.xls") : object 'mydata' not found/ these are my codes, can you help give an advice or idea with my problem: /library("biOps") library("waveslim") library("xlsReadWrite") x <- readTiff("D:\\FYP\\image\\SignatureImage\\user186g1.tif") y <- imgBlockMedianFilter(x, 5) #Plot image #plot(y) y.modwt <- modwt.2d(y, "la8", 2) ## Level 2 decomposition par(mfrow=c(2,2), pty="s") ##Plot wavelets image(y.modwt$LH2, col=rainbow(128), axes=FALSE, main="LH2") image(y.modwt$HH2, col=rainbow(128), axes=FALSE, main="HH2") image(y.modwt$LL2, col=rainbow(128), axes=FALSE, main="LL2") image(y.modwt$HL2, col=rainbow(128), axes=FALSE, main="HL2") #---# ##Get the dimension ##LH2 dimLH2 <- dim(y.modwt$LH2) dimLH2x <- dimLH2[1] dimLH2y <- dimLH2[2] varLH2xlist <- c(rep(0, dimLH2x)) varLH2ylist <- c(rep(0, dimLH2y)) ##Loop to get variance from x axis for(i in seq(dimLH2x)){ varLH2xlist[i] <- var(y.modwt$LH2[i,]) } ##Get the variance from the overall x variance varLH2x <- var(varLH2xlist) ##Loop to get variance from y axis for(i in seq(dimLH2y)){ varLH2ylist[i] <- var(y.modwt$LH2[,i]) } ##Get the variance from the overall y variance varLH2y <- var(varLH2ylist) #-# ##Get the dimension ##HH2 dimHH2 <- dim(y.modwt$HH2) dimHH2x <- dimHH2[1] dimHH2y <- dimHH2[2] varHH2xlist <- c(rep(0, dimHH2x)) varHH2ylist <- c(rep(0, dimHH2y)) ##Loop to get variance from x axis for(i in seq(dimHH2x)){ varHH2xlist[i] <- var(y.modwt$HH2[i,]) } ##Get the variance from the overall x variance varHH2x <- var(varHH2xlist) ##Loop to get variance from y axis for(i in seq(dimHH2y)){ varHH2ylist[i] <- var(y.modwt$HH2[,i]) } ##Get the variance from the overall y variance varHH2y <- var(varHH2ylist) #-# ##Get the dimension ##LL2 dimLL2 <- dim(y.modwt$LL2) dimLL2x <- dimLL2[1] dimLL2y <- dimLL2[2] varLL2xlist <- c(rep(0, dimLL2x)) varLL2ylist <- c(rep(0, dimLL2y)) ##Loop to get variance from x axis for(i in seq(dimLL2x)){ varLL2xlist[i] <- var(y.modwt$LL2[i,]) } ##Get the variance from the overall x variance varLL2x <- var(varLL2xlist) ##Loop to get variance from y axis for(i in seq(dimLL2y)){ varLL2ylist[i] <- var(y.modwt$LL2[,i]) } ##Get the variance from the overall y variance varLL2y <- var(varLL2ylist) #-# ##Get the dimension ##HL2 dimHL2 <- dim(y.modwt$HL2) dimHL2x <- dimHL2[1] dimHL2y <- dimHL2[2] varHL2xlist <- c(rep(0, dimHL2x)) varHL2ylist <- c(rep(0, dimHL2y)) ##Loop to get variance from x axis for(i in seq(dimHL2x)){ varHL2xlist[i] <- var(y.modwt$HL2[i,]) } ##Get the variance from the overall x variance varHL2x <- var(varHL2xlist) ##Loop to get variance from y axis for(i in seq(dimHL2y)){ varHL2ylist[i] <- var(y.modwt$HL2[,i]) } ##Get the variance from the overall y variance varHL2y <- var(varHL2ylist) #-# ##write excel file write.xls(mydata, "D:\\FYP\\image.mydata.xls")/ -- View this message in context: http://r.789695.n4.nabble.com/write-data-using-xlsReadWrite-tp4629825.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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.
Re: [R] Poblems wih EBImage
hello, I think my EBImage is succesfully unpacked using R and I receive this message package 'EBImage' successfully unpacked and MD5 sums checked The downloaded packages are in C:\Users\Yana-Chan\AppData\Local\Temp\Rtmp7VFmH5\downloaded_packages but when I try to call the library, I receive this > library("EBImage") Loading required package: abind Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Program Files/R/R-2.13.2/library/EBImage/libs/i386/EBImage.dll': LoadLibrary failure: The specified module could not be found. Error: package/namespace load failed for 'EBImage' Do you have an explanation what went wrong? Thank you -- View this message in context: http://r.789695.n4.nabble.com/Poblems-wih-EBImage-tp1902367p4416856.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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.
Re: [R] Poblems wih EBImage
Yes, I'm using windows. Thank you. I made some improvement, I think, but then why did I receive this? > utils:::menuInstallLocal() package 'EBImage' successfully unpacked and MD5 sums checked > library("EBImage") Error: package 'EBImage' was built before R 2.10.0: please re-install it which one did I need to re-install? The EBImage or the R? Thank you? -- View this message in context: http://r.789695.n4.nabble.com/Poblems-wih-EBImage-tp1902367p3947242.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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.
Re: [R] Poblems wih EBImage
Hai, can you help me. Why am I having this lines of errors? please help me. thank you. > library("EBImage") Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Program Files/R/R-2.13.2/library/EBImage/libs/i386/EBImage.dll': LoadLibrary failure: The specified module could not be found. Error: package/namespace load failed for 'EBImage' > lena = readImage(f) Error: could not find function "readImage" -- View this message in context: http://r.789695.n4.nabble.com/Poblems-wih-EBImage-tp1902367p3946830.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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.