3h
comment R - determine if string can be eval'ed to a function without using eval()
Sorry, missed the smiley.
3h
comment R - determine if string can be eval'ed to a function without using eval()
Using regular expressions is limited and obviously that and many other examples will not be handled but its not clear how comprehensive the solution needs to be. If something simple that can distinguish between the examples shown is sufficient then this is only one line of code.
4h
answered R - determine if string can be eval'ed to a function without using eval()
18h
awarded Nice Answer
18h
comment generating sql statements from data returned in R by Postgresql
I assume its system dependent (I'm using Windows). I have added a second argument to force it to produce double quotes.
18h
revised generating sql statements from data returned in R by Postgresql
added 14 characters in body
20h
comment generating sql statements from data returned in R by Postgresql
No. There are no extra backslashes. The backslashes you see are NOT part of the string. I have added a cat at the end to show it.
20h
revised generating sql statements from data returned in R by Postgresql
added 115 characters in body
20h
revised generating sql statements from data returned in R by Postgresql
added 25 characters in body
20h
answered generating sql statements from data returned in R by Postgresql
1d
answered Finding difference between date-times in same column separated by some number of rows
1d
awarded sqldf
2d
answered Linear regression for multivariate time series in R
2d
comment Which R time/date class and package to use?
-1 This is a misleading and biased account when it comes to zoo/xts and is not recommended. I suggest you read the 5 zoo vignettes, 1 xts vignette and the 2 reference manuals for accurate information. For example, the ebook's 2nd question is supposed to explain the difference between zoo/xts and timeSeries but it nowhere mentions the key difference which is that zoo is general in its handling of any time/date index class that satisfies certain minimal properties whereas timeSeries is hardcoded to use a particular one internally.
2d
comment Cumulative sum by rolling window of time
It wasn't me who downvoted but maybe there was a concern that the output was not sufficiently explained in detail.
Jul
20
comment Get graph of the weekly season for a time series with daily frequency
@DannyP, Objects of "Date" class are internally days since the Epoch so successive days are one unit apart; thus, to have a week represent one unit divide by 7: library(zoo); z <- read.zoo(my_data, format = "%m/%d/%y"); time(z) <- as.numeric(time(z))/7.
Jul
20
comment Get graph of the weekly season for a time series with daily frequency
stl cannot be used with "Date" class data. The data must be regularly spaced and one period must have the duration of 1.
Jul
19
revised R How to combine two matrices by row name when they have different numbers of rows
added 284 characters in body
Jul
19
revised R How to combine two matrices by row name when they have different numbers of rows
added 1a and 2
Jul
19
revised R How to combine two matrices by row name when they have different numbers of rows
rownames
1 2 3 4 5