2

This is my first question on SO

I loaded a CSV file into R Notebook using

train -> fread("name.csv")

Used head(train) which displayed first 6 rows. Everything was working fine. Then i tried converting the data type of Date column from default char to Date using train[, Date := as.Date(Date)]. Data type got converted to Date but my R Notebook stopped displaying results for commands like head(train), train[1:2]...it just did not display first 6 rows, nothing at all.

The problem started after putting this command train[, Date := as.Date(Date)]. So I removed it and rechecked if my R Notebook was displaying results for head(train) etc. It worked, R Notebook was back to displaying results.

I used R console to check if it was a unique issue with notebook. Turns out that it is. Everything worked fine in traditional R console.

I was not sure what would be the right title for this question. How to get it work?

Update: Putting [ ] at the end of train[, Date := as.Date(Date)] does not work

rajesh-nitc
  • 5,049
  • 3
  • 25
  • 33
  • Can you use `dput()` to give us a part of your data table? In this way we can have look at what is happening. – ricoderks Mar 20 '17 at 12:04
  • Probable dupe of http://stackoverflow.com/q/32988099/ So I'd try adding trailing brackets `DT[...][]`. Knitr had a similar problem until recently, I think. – Frank Mar 20 '17 at 14:57

0 Answers0