Skip to content
Prev 316402 / 398503 Next

I succeed to get result dataset.

HI,

temp<-read.table(text="
?ID??????? CTIME?? ACTIVE_KWH REACTIVE_KWH
1? HM001 201212121301 1201.9 1115.5
2? HM001 201212121302 1202.2 1115.8
3? HM001 201212121303 1202.8 1115.8
4? HM001 201212121304???? NA 1116.1
5? HM001 201212121305 1203.9 1116.7
6? HM001 201212121306???? NA 1116.7
7? HM001 201212121307???? NA 1116.7
8? HM001 201212121308?? 12.0?? 31.0
9? HM001 201212121309 1206.0 1118.2
10 HM001 201212121310 1206.3 1118.6
11 HM001 201212121311 1206.5 1118.8
12 HM001 201212121312???? NA???? NA
13 HM001 201212121313 1207.3???? NA
14 HM001 201212121314 1207.9 1121.1
15 HM001 201212121315 1208.4 1121.3
",sep="",header=TRUE,stringsAsFactors=F)

#Here, I assume that you consider <1000 as low values, You can change it accordingly.
?temp[,3:4][temp[,3]<1000& !is.na(temp[,3]),]<-NA
?temp
#????? ID??????? CTIME ACTIVE_KWH REACTIVE_KWH
#1? HM001 201212121301???? 1201.9?????? 1115.5
#2? HM001 201212121302???? 1202.2?????? 1115.8
#3? HM001 201212121303???? 1202.8?????? 1115.8
#4? HM001 201212121304???????? NA?????? 1116.1
#5? HM001 201212121305???? 1203.9?????? 1116.7
#6? HM001 201212121306???????? NA?????? 1116.7
#7? HM001 201212121307???????? NA?????? 1116.7
#8? HM001 201212121308???????? NA?????????? NA
#9? HM001 201212121309???? 1206.0?????? 1118.2
#10 HM001 201212121310???? 1206.3?????? 1118.6
#11 HM001 201212121311???? 1206.5?????? 1118.8
#12 HM001 201212121312???????? NA?????????? NA
#13 HM001 201212121313???? 1207.3?????????? NA
#14 HM001 201212121314???? 1207.9?????? 1121.1
#15 HM001 201212121315???? 1208.4?????? 1121.3


#Suppose your dataset is like this:
temp1<-read.table(text="
?ID??????? CTIME?? ACTIVE_KWH REACTIVE_KWH
1? HM001 201212121301 1201.9 1115.5
2? HM001 201212121302 1202.2 1115.8
3? HM001 201212121303 1202.8 1115.8
4? HM001 201212121304???? NA 1116.1
5? HM001 201212121305 1203.9 1116.7
6? HM001 201212121306???? NA 1116.7
7? HM001 201212121307???? NA 1116.7
8? HM001 201212121308?? 12.0?? 31.0
9? HM001 201212121309 1206.0 1118.2
10 HM001 201212121310 21.0 1118.6
11 HM001 201212121311 1206.5 1118.8
12 HM001 201212121312???? NA???? NA
13 HM001 201212121313 1207.3???? NA
14 HM001 201212121314 1207.9 1121.1
15 HM001 201212121315 1208.4 22.0
",sep="",header=TRUE,stringsAsFactors=F)
temp1[,3][temp1[,3]<1000&!is.na(temp[,3])]<-NA
?temp1[,4][temp1[,4]<1000&!is.na(temp[,4])]<-NA

Hope it helps.

A.K.
Message-ID: <1359469710.79166.YahooMailNeo@web142601.mail.bf1.yahoo.com>
In-Reply-To: <18257343f2945e85945d41444ff8fdd@tweb03.nm.nhnsystem.com>