Posts by Wilson Freitas • 263 points
6 posts
-
1
votes1
answer469
viewsA: Overlay graphics with ggplot2?
A Quick-and-Dirty solution would be to create the point with a data.frame. g + geom_point(data=data.frame(x=-0.4, y=0.5), aes(x=x, y=y), colour='white')
-
3
votes1
answer50
viewsQ: Why does the for-loop convert from Date to integer?
Can anyone explain why in for-loop the objects Date are converted to integer? In the code below I want to iterate on the dates but these are converted to integers. > dates <- Sys.Date() + 1:10…
-
1
votes4
answers19992
viewsA: How to transport data from R to excel?
Even using Excel I prefer to work with CSV files (text always!), which with proper formatting, open in Excel smoothly. To create the CSV files I like to use the write.table. For the files to be…
-
3
votes5
answers8758
viewsA: How to remove line that has Missing?
The function subset resolve this directly and more clearly, in my opinion. This can be done in conjunction with the function is.na the variable of interest being applied. > data.frame(x=1:12,…
ranswered Wilson Freitas 263 -
3
votes2
answers3041
viewsA: How to separate the characters of a string in R?
For any string-related transformation I suggest the stringr. The function str_split always returns a list, regardless of whether it receives a vector with 1 or more elements. >…
-
2
votes3
answers656
viewsA: Commands as. Date and srtptime in R
The function dmy of lubridate can interpret dates considering what they see as (day, month, year): library(lubridate) dmy(datas) # [1] "2014-12-26 UTC" "2014-12-27 UTC" "2014-12-28 UTC" "2014-12-29…