q**j 发帖数: 10612 | 1 打算用seq.Date来increment 一个data frame的一列日期。但是seq.Date一次只能
increment一个日期。apply函数不能用date类型的input。很为难。请问高手有没有好
办法。多谢了。 |
c*****m 发帖数: 4817 | 2 what do you mean "increment 一个data frame的一列日期"?
>a
[1] "2009-05-15" "2009-05-17" "2009-05-19" "2009-05-22" "2009-05-24"
[6] "2009-05-26" "2009-05-28" "2009-05-30" "2009-06-01" "2009-06-03"
> a + 1
[1] "2009-05-16" "2009-05-18" "2009-05-20" "2009-05-23" "2009-05-25"
[6] "2009-05-27" "2009-05-29" "2009-05-31" "2009-06-02" "2009-06-04"
【在 q**j 的大作中提到】 : 打算用seq.Date来increment 一个data frame的一列日期。但是seq.Date一次只能 : increment一个日期。apply函数不能用date类型的input。很为难。请问高手有没有好 : 办法。多谢了。
|
q**j 发帖数: 10612 | 3 你这个是一天。我想要整齐地increment一个月。input和output是同一天。
【在 c*****m 的大作中提到】 : what do you mean "increment 一个data frame的一列日期"? : >a : [1] "2009-05-15" "2009-05-17" "2009-05-19" "2009-05-22" "2009-05-24" : [6] "2009-05-26" "2009-05-28" "2009-05-30" "2009-06-01" "2009-06-03" : > a + 1 : [1] "2009-05-16" "2009-05-18" "2009-05-20" "2009-05-23" "2009-05-25" : [6] "2009-05-27" "2009-05-29" "2009-05-31" "2009-06-02" "2009-06-04"
|
s*****n 发帖数: 2174 | 4 就用seq.Date就可以啊, 为什么不行?
顶多就是稍微做个简单的wrapper而已.
date.increment <- function(date.list, by){
num.days <- unlist(lapply(1:length(date.list),
function(i) seq.Date(from = as.Date(date.list[i]), by = by, length =
2)[2]))
return(as.Date(num.days, origin = "1970-01-01"))
}
date.increment(c("2010-10-01", "2010-10-10"), by = "1 month")
【在 q**j 的大作中提到】 : 你这个是一天。我想要整齐地increment一个月。input和output是同一天。
|
q**j 发帖数: 10612 | 5 再次感谢!
【在 s*****n 的大作中提到】 : 就用seq.Date就可以啊, 为什么不行? : 顶多就是稍微做个简单的wrapper而已. : date.increment <- function(date.list, by){ : num.days <- unlist(lapply(1:length(date.list), : function(i) seq.Date(from = as.Date(date.list[i]), by = by, length = : 2)[2])) : return(as.Date(num.days, origin = "1970-01-01")) : } : date.increment(c("2010-10-01", "2010-10-10"), by = "1 month")
|
q**j 发帖数: 10612 | 6 对了,能不能介绍一下windows下面哪个editor和R一起用比较好。多谢了。
【在 s*****n 的大作中提到】 : 就用seq.Date就可以啊, 为什么不行? : 顶多就是稍微做个简单的wrapper而已. : date.increment <- function(date.list, by){ : num.days <- unlist(lapply(1:length(date.list), : function(i) seq.Date(from = as.Date(date.list[i]), by = by, length = : 2)[2])) : return(as.Date(num.days, origin = "1970-01-01")) : } : date.increment(c("2010-10-01", "2010-10-10"), by = "1 month")
|
s*****n 发帖数: 2174 | 7 我就用R自带的editor.
【在 q**j 的大作中提到】 : 对了,能不能介绍一下windows下面哪个editor和R一起用比较好。多谢了。
|
q**j 发帖数: 10612 | 8 这个连shift+tab都不支持。编辑起来好像不方便。难道你有别的诀窍?
【在 s*****n 的大作中提到】 : 我就用R自带的editor.
|
D*********2 发帖数: 535 | |
s*****n 发帖数: 2174 | 10 shift tab 是干什么用的?
【在 q**j 的大作中提到】 : 这个连shift+tab都不支持。编辑起来好像不方便。难道你有别的诀窍?
|
|
|
q**j 发帖数: 10612 | 11 在SAS和matlab里面,shift+tab可以让selection向左边move一个tab的space。copy
paste以后很有用。
【在 s*****n 的大作中提到】 : shift tab 是干什么用的?
|
s*****n 发帖数: 2174 | 12 hehe, 我土人一个, 没用过这个功能.
从本科最开始接触R, 就一直用R自带的editor.
在Linux下面, 我也一直用不惯ESS, 所以一直就用
普通的editor, 然后copy&paste来执行.
【在 q**j 的大作中提到】 : 在SAS和matlab里面,shift+tab可以让selection向左边move一个tab的space。copy : paste以后很有用。
|
a****r 发帖数: 1486 | 13 试试Revolution R enterprise版本
acdemic用途是免费的
【在 q**j 的大作中提到】 : 对了,能不能介绍一下windows下面哪个editor和R一起用比较好。多谢了。
|
D******n 发帖数: 2836 | 14 ya, Vim is enough...lol.
【在 s*****n 的大作中提到】 : hehe, 我土人一个, 没用过这个功能. : 从本科最开始接触R, 就一直用R自带的editor. : 在Linux下面, 我也一直用不惯ESS, 所以一直就用 : 普通的editor, 然后copy&paste来执行.
|
s*****n 发帖数: 2174 | 15 我起初也是Emacs, 后来也改用Vim了.
【在 D******n 的大作中提到】 : ya, Vim is enough...lol.
|
l*********s 发帖数: 5409 | 16 what would be the ess counterpart for vi?
【在 s*****n 的大作中提到】 : 我起初也是Emacs, 后来也改用Vim了.
|
s*****n 发帖数: 2174 | 17 none.
就是因为不喜欢ESS和Emacs才转到Vi的, simple and fast.
【在 l*********s 的大作中提到】 : what would be the ess counterpart for vi?
|
D******n 发帖数: 2836 | 18 Yeah, VI rocks VI rules.
【在 s*****n 的大作中提到】 : none. : 就是因为不喜欢ESS和Emacs才转到Vi的, simple and fast.
|
q**j 发帖数: 10612 | 19 I tried Tinn-R, Eclipse and the Notepad++. Notepad++ is the best. It is simp
le and easy to manipulate than the other two. Thanks alot for the help.
BTW, I figured out 'pass selection; now.
【在 D*********2 的大作中提到】 : 狂推荐notepad++组合NpptoR
|
D*********2 发帖数: 535 | 20
simp
那有包子没 :ppp
【在 q**j 的大作中提到】 : I tried Tinn-R, Eclipse and the Notepad++. Notepad++ is the best. It is simp : le and easy to manipulate than the other two. Thanks alot for the help. : BTW, I figured out 'pass selection; now.
|
|
|
f***a 发帖数: 329 | 21 emacs+ess很好用啊,开两个窗口,一个运行R一个写code,用起来感觉完全就是
windows下的
Rgui+自带editor嘛。
【在 s*****n 的大作中提到】 : none. : 就是因为不喜欢ESS和Emacs才转到Vi的, simple and fast.
|
D******n 发帖数: 2836 | 22 Many ppl don't like the emacs style of editing.
【在 f***a 的大作中提到】 : emacs+ess很好用啊,开两个窗口,一个运行R一个写code,用起来感觉完全就是 : windows下的 : Rgui+自带editor嘛。
|
f***a 发帖数: 329 | 23 emacs可以纯键盘操作,完全不需要鼠标,用得熟练的话效率非常高。
不过正因为如此比较难上手,我用到现在也是才入门,太懒没多研究。
有些地方是比较不爽,譬如从别的地方cltr+c copy的东西在emacs里面ctrl+y粘贴不了
(反之亦
然),每次还得点menu;alt+w(ctrl+w)剪切一些东西然后highlight+del另外一部分东
西,再用
ctrl+y粘贴的话是del的东西不是剪切的东西。谁有经验,这两个问题有啥快捷的解决
办法?
不过整体来说,emacs还是很好用的,R/C++/Latex都支持,基本上是我在Linux下用得
做多的3个东
西了。
【在 D******n 的大作中提到】 : Many ppl don't like the emacs style of editing.
|
D******n 发帖数: 2836 | 24 I meant, in comparison to VI, emacs is hard to use for many people. VI and
Emacs are the major two camps of modal editing based text editors with VI
slightly more popular.
【在 f***a 的大作中提到】 : emacs可以纯键盘操作,完全不需要鼠标,用得熟练的话效率非常高。 : 不过正因为如此比较难上手,我用到现在也是才入门,太懒没多研究。 : 有些地方是比较不爽,譬如从别的地方cltr+c copy的东西在emacs里面ctrl+y粘贴不了 : (反之亦 : 然),每次还得点menu;alt+w(ctrl+w)剪切一些东西然后highlight+del另外一部分东 : 西,再用 : ctrl+y粘贴的话是del的东西不是剪切的东西。谁有经验,这两个问题有啥快捷的解决 : 办法? : 不过整体来说,emacs还是很好用的,R/C++/Latex都支持,基本上是我在Linux下用得 : 做多的3个东
|
l*********s 发帖数: 5409 | 25 I tend to forget which mode vi is in and the default mapping of arrow keys
is difficult to get used.
and
VI
【在 D******n 的大作中提到】 : I meant, in comparison to VI, emacs is hard to use for many people. VI and : Emacs are the major two camps of modal editing based text editors with VI : slightly more popular.
|
q**j 发帖数: 10612 | 26 码工才要写的飞快吧。用notepad, notepad++这种方便多了。稍微慢点也许思考的时间
还比较多些。再说notepad++, eclipse这些都可以自己设快捷键,好像也没什么不好的。
【在 f***a 的大作中提到】 : emacs可以纯键盘操作,完全不需要鼠标,用得熟练的话效率非常高。 : 不过正因为如此比较难上手,我用到现在也是才入门,太懒没多研究。 : 有些地方是比较不爽,譬如从别的地方cltr+c copy的东西在emacs里面ctrl+y粘贴不了 : (反之亦 : 然),每次还得点menu;alt+w(ctrl+w)剪切一些东西然后highlight+del另外一部分东 : 西,再用 : ctrl+y粘贴的话是del的东西不是剪切的东西。谁有经验,这两个问题有啥快捷的解决 : 办法? : 不过整体来说,emacs还是很好用的,R/C++/Latex都支持,基本上是我在Linux下用得 : 做多的3个东
|