(R beginner here…) I have a dataset like:
> head(q)
Date Time System User
1 2011-10-01 00:00:01 12.4 4.6
2 2011-10-01 01:00:02 27.4 1.8
3 2011-10-01 02:00:01 15.2 1.0
4 2011-10-01 03:00:01 19.8 2.4
5 2011-10-01 04:00:02 19.2 3.4
6 2011-10-01 05:00:01 17.8 1.8
> nrow(q)
[1] 2207
Where ‘Date Time’ was formed from raw csv data with as.POSIXct(…)
But when I try a plot with more than 1300 rows:
> qplot(q$'Date Time',q$'User');dev.off() Error: cannot allocate vector of size 9.8 Gb
And it’s the same with:
> ggplot(q,aes(q$'Date Time',q$'User'))+geom_point(); dev.off() Error: cannot allocate vector of size 9.8 Gb
What can I do to make it work? I want a scatter of system performance metrics which is spread over three months – the data is hourly so theres about 2200 rows.
You are using the aes function wrong. You use:
while the correct would be:
There is no need to feed a vector of data to aes. You could try to see if it helps.
In addition,
A good tip is also to use
ggsaveto save your ggplot’s to file.