我必须从http://www.python.org/download/releases/2.5.4/安装Python 2.5.4,这是pcraster程序所必需的.
但是
对于x86处理器有三个python选择:python-2.5.4.msi
对于Win64-Itanium用户:python-2.5.4.ia64.msi
对于Win64-AMD64用户:python-2.5.4.amd64.msi
我知道我有Win64,但我不确定我的i7处理器是Itanium还是AMD?知识渊博的人能帮助我吗?
我已经在Windows中安装了vim并且想配置它以便我可以向R发送代码.我也想用它来使用Sweave.但是,我已经谷歌搜索并没有找到关于如何设置它的明确的逐步说明.
到目前为止我的尝试:
"必须启用Python界面才能运行Vim-R-Plugin.请执行':h-plugin-installation details
当我输入这个我得到
error149,对r-plugin-installation没有帮助
我也没有看到将代码发送给R的按钮.
我无法理解"您可能需要调整| vimrplugin_sleeptime |的值"的说明.
我该怎么办? - 我的PC上已经安装了Miktex 2.9.Vim会看到它吗?如何设置Vim以查看Latex?将不胜感激任何帮助.
注意:我使用了rstudio与Sweave以及eclipse但是我需要解决一些问题,因此需要尝试使用vim并查看它是如何工作的.
几年前,我编写了一个 dll,其中包含一些用于运行水文模型的函数。我忘记了 dll 内函数的名称和参数,不幸的是我忘记写一个好的文档文件。这些功能很复杂,所以我不想经历我可以使用的需要重写代码的替代方案。
我已将 dll 加载到 R 中,但正如我所说,我既不记得函数的名称,也不记得函数的语法。
如何列出函数以及如何查看函数的语法和我应该提供的参数?我知道参数是常见的模型输入,但老实说我不记得格式了。
此外,加载 dll 不会给出错误,但检查它是否已加载会给出FALSE。我怎样才能解决这个问题?
> x<-dyn.load("hbv_R64.dll")
> is.loaded("hbv_R64")
[1] FALSE
Run Code Online (Sandbox Code Playgroud) 下面是我的 R 代码,它的行为很奇怪。我预计输入的时间为 22:00,但我得到的是 23:00。
as.POSIXct(chron(dates="01/04/06",times="22:00:00"),tz="CET")
[1] "2006-01-04 23:00:00 CET"
Run Code Online (Sandbox Code Playgroud)
在我的代码的下一行中,我使用结果从 xts/zoo 对象中选择一个窗口:因此,忽略错误并输入 21:00 (上面)是没有用的,因为它返回错误的数据。使用上述代码的结果进行窗口化会返回正确的值。
head(qs<-as.zoo(window(Q,start=as.POSIXct(chron(dates="01/04/06",times="22:00:00"),tz="CET"),end=as.POSIXct(chron(dates="01/05/06",times="21:00:00"),tz="CET"))))
Run Code Online (Sandbox Code Playgroud)
以下是数据样本集 ( Q):
Stage.Qm Flow.Qm Stage.QmDB Flow.QmDB Stage.Q1000 Flow.Q1000 Stage.Q1000DB Flow.Q1000DB
2006-01-04 23:00:00 541.1589 5.636957 541.1592 5.646017 541.5708 20.44692 541.5708 20.44692
2006-01-04 23:01:00 541.1589 5.637268 541.1592 5.645087 541.5701 20.41321 541.5701 20.41321
2006-01-04 23:02:00 541.1589 5.638604 541.1588 5.635806 541.5701 20.40946 541.5701 20.40946
2006-01-04 23:03:00 541.1589 5.638979 541.1588 5.635694 541.5704 20.42712 541.5704 20.42712
2006-01-04 23:04:00 541.1589 5.639619 541.1590 5.640691 541.5710 20.45848 541.5710 20.45848
2006-01-04 23:05:00 …Run Code Online (Sandbox Code Playgroud) 我试过这个,但我在 eval(expr,envir, enclos) 中得到错误:找不到对象“组”。pj4s 是一个包含经纬度投影的对象。
我的代码
fx.ggplot<-function(ctry,aesfill="id",scalefill="Country",pathcol="white"){
#ctry is a shapefile of countries
ctry@data$id = rownames(ctry@data)
ctry.points = fortify(ctry, region="id")
ctry.df = join(ctry.points, ctry@data, by="id")
(txt<-paste("p<-ggplot(ctry.df) + aes(long,lat,group=group,fill=",aesfill,")"))
eval(parse(text=txt))
p<-p+ geom_polygon() +
geom_path(color=pathcol) +
coord_equal() +
scale_fill_brewer(scalefill)
return(p)
}
#generate a grid of points
xo<-seq(25,45,0.5)
yo<-seq(-15,5,0.5)
head(xy<-cbind(expand.grid(xo,yo)));names(xy)<-c("lon","lat")
head(xy.sp <- SpatialPoints(xy,proj4string=pj4s))
Overlay<-over(xy.sp,ctry)
xy<-xy[!apply(Overlay, 1, function(x) any(is.na(x))),]
#plot
(p<-fx.ggplot(ctry))
Run Code Online (Sandbox Code Playgroud)

(P<-p+geom_point(data=xy, aes(x=lon, y=lat))) #addpoints returns Error
ggplot()+geom_point(data=xy, aes(x=lon, y=lat)) #This plots the points (as below) without error but in a new plot.
Run Code Online (Sandbox Code Playgroud)

#matrix …Run Code Online (Sandbox Code Playgroud)