I have my data in a list which I can access like:
- print(max(gaDataEcommerce4$date))
Now, I save it in a text file in HDFS and what I read back from this file is a raw object.
I then convert it to a list but on trying to access $date get null.
<code>getLastDataImportDate =function(){
hdfs.init()
f = hdfs.file("/user/rstudio/gaDataEcommerce4","r")
m = hdfs.read(f)
print(typeof(m))//raw
m1 <- m
mnull <- m == as.raw(0)//What is happening here?
m1[mnull]<- as.raw(20)//and here?
c <- rawToChar(m1)
print(c)
print(typeof(c))//character
df = as.list(c)
print(df)
print(df$date)//NULL}
- I could not directly use
rawToChar
function because I have nulls in the data.
So found this for the fix but I would really like to know what exactly is happening at these 2 lines.
<code> mnull <- m == as.raw(0)//What is happening here?
m1[mnull]<- as.raw(20)//and here?
Also, I tried converting it to a list but
df$date
gives NULL. Why exactly is that? I need to get max(df$date), how else would I get it?