Skip to content

Commit

Permalink
Merge pull request #49 from wadpac/wavreadfix
Browse files Browse the repository at this point in the history
mistake fixed: header is a vector not a matrix when freshly loaded
  • Loading branch information
vincentvanhees authored Aug 6, 2017
2 parents e03eb40 + 971e156 commit a4219d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/g.wavread.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ g.wavread = function(wavfile,start=1,end=100,units="minutes") {
header = rownames(read.csv(wavfile,skipNul=TRUE,nrow=15,header=TRUE,fileEncoding="latin1"))
}
scale3position = grep("Scale-3",header)
header = header[1:scale3position,]
header = header[1:scale3position]
P = sapply(as.character(header),function(x) {
tmp = unlist(strsplit(x,": "))
if (length(tmp) == 1) {
Expand Down Expand Up @@ -54,4 +54,4 @@ g.wavread = function(wavfile,start=1,end=100,units="minutes") {
# g = (B$C4/ range) # temperature, light and battery ?
invisible(list(rawxyz=rawxyz,header=P,timestamp = timestamp))

}
}

0 comments on commit a4219d2

Please sign in to comment.