> head(returnee)
[1] 1.3936536 -0.6730667 2.3584725 2.3477308 3.2841443 1.3168157
> head(vixee)
[1] 14.75 15.45 17.59 17.74 17.75 18.35
> class(returnee)
[1] "numeric"
> class(vixee)
[1] "numeric"
> plot(returnee, vixee)
> abline(lm(returnee ~ vixee))
Run Code Online (Sandbox Code Playgroud)
当我运行它时,它给出了情节,但没有下划线.有什么建议?谢谢.
我正在尝试使用Rails 3.1 +设计模块:使用此模板确认 + MongoID:
https://github.com/RailsApps/rails3-application-templates/raw/master/rails3-mongoid-devise-template.rb
Mi模板工作正常,但现在我用下一个命令生成可确认的视图:
rails generate devise:视图可确认
生成这个:
invoke Devise::Generators::SharedViewsGenerator
create app/views/confirmable/mailer
create app/views/confirmable/mailer/confirmation_instructions.html.erb
create app/views/confirmable/mailer/reset_password_instructions.html.erb
create app/views/confirmable/mailer/unlock_instructions.html.erb
create app/views/confirmable/shared
create app/views/confirmable/shared/_links.erb
invoke form_for
create app/views/confirmable/confirmations
create app/views/confirmable/confirmations/new.html.erb
create app/views/confirmable/passwords
create app/views/confirmable/passwords/edit.html.erb
create app/views/confirmable/passwords/new.html.erb
create app/views/confirmable/registrations
create app/views/confirmable/registrations/edit.html.erb
create app/views/confirmable/registrations/new.html.erb
create app/views/confirmable/sessions
create app/views/confirmable/sessions/new.html.erb
create app/views/confirmable/unlocks
create app/views/confirmable/unlocks/new.html.erb
Run Code Online (Sandbox Code Playgroud)
我抓住下一个错误来刷新页面:
Devise/sessions中的NoMethodError #new
undefined method `new_confirmation_path' for #<#<Class:0xb94bb04>:0xb948b20>
11: <% end -%>
12:
13: <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14: <%= link_to "Didn't …Run Code Online (Sandbox Code Playgroud) 在尝试实现一些优化算法时,我注意到R引用类中有一些奇怪的行为.在特定的初始化方法中似乎存在一些幕后解析魔法,这使得难以使用匿名函数.下面是一个说明难度的示例:我定义了一个优化函数(f_opt),一个对其运行优化的函数,以及一个将这两个作为方法的引用类.奇怪的行为将在代码中更清晰
f_opt <- function(x) (t(x)%*%x)
do_optim_opt <- function(x) optim(x,f)
do_optim2_opt <- function(x)
{
f(x) #Pointless extra evaluation
optim(x,f)
}
optClass <- setRefClass("optClass",methods=list(do_optim=do_optim_opt,
do_optim2=do_optim2_opt,
f=f_opt))
oc <- optClass$new()
oc$do_optim(rep(0,2)) #Doesn't work: Error in function (par) : object 'f' not found
oc$do_optim2(rep(0,2)) #Works.
oc$do_optim(rep(0,2)) #Parsing magic has presumably happened, and now this works too.
Run Code Online (Sandbox Code Playgroud)
它只是我,还是看起来像其他人的错误?
我有一些数据,说(实际上,我有大量的数据):
x y
0.1 0.267
0.2 0.254
0.3 0.182
0.4 0.173
0.5 0.121
0.6 0.089
0.7 0.070
0.8 0.056
0.9 0.031
Run Code Online (Sandbox Code Playgroud)
这个数据大致遵循我用ggplot stat_smooth()绘制的趋势曲线.stat_smooth创建一个灰色区域,95%确信趋势线会落入其中.
我想要做的是在趋势线所在的周围创建一个灰色区域,假设围绕趋势线的正态分布,数据点将以95%的置信度创建一个灰色区域.
另一种说法是,我想要一个smooth_lines连接误差条的顶部和底部,并在ggplot中遮蔽.我应该怎么做呢?
谢谢.
我是android的新手..我正在开发App App ...我的问题是在添加In App产品时,Managed和Unmanaged状态的主要目的是什么..
任何人都可以告诉我什么是托管状态的使用以及非托管状态的用途是什么.
我有关于搜索栏的问题.我尝试了几件事,但没有任何帮助.我想更改搜索栏的高度,但不是完整的搜索栏,只有用拇指滚动的栏.我尝试了几个例子,例如setBackGroundDrawable和setProgressDrawable,并制作了我自己的drawables,但drawable-size固定为Standard-Android-Seekbar的大小.我现在能做什么?
我正在运行最新的Zend社区服务器并想学习Symfony2,但是config.php给了我一个错误,我的APC(替代php缓存)已被弃用,我必须升级它.
我正在运行OS X Lion并且已经找到了zend文件夹:
/usr/local/zend/
Run Code Online (Sandbox Code Playgroud)
我还从http://pecl.php.net下载了源代码包(3.1.9 stable),但不知道如何编译它或放在哪里.
我正在使用SAS中的数据集,其中包含许多变量.
其中一个变量是DATE变量,它具有日期/时间格式.它看起来像这样:
12FEB97:00:00:00
27MAR97:00:00:00
14APR97:00:00:00
Run Code Online (Sandbox Code Playgroud)
现在问题是我想将此变量转换为NUMERIC格式.我希望得到以下结果(基于之前显示的3个示例):
199702
199703
199704
Run Code Online (Sandbox Code Playgroud)
你有什么想法怎么做吗?我已经阅读了很多文档,pdf等,但仍然找不到合适的解决方案.
非常感谢你!
这是我的数据:
> head(Kandula_for_n)
date dist date_only
1 2005-05-08 12:00:00 138.5861 2005-05-08
2 2005-05-08 16:00:00 1166.9265 2005-05-08
3 2005-05-08 20:00:00 1270.7149 2005-05-08
6 2005-05-09 08:00:00 233.1971 2005-05-09
7 2005-05-09 12:00:00 1899.9530 2005-05-09
8 2005-05-09 16:00:00 726.8363 2005-05-09
Run Code Online (Sandbox Code Playgroud)
我现在想要一个额外的列,每天有数据条目(dist)的count(n).对于2005-05-08,这将是n = 3,因为在12,16和20时有3个数据条目.我已应用以下代码实际上给了我想要的我想要的代码:
ndist <-tapply(1:NROW(Kandula_for_n), Kandula_for_n$date_only, function(x) length(unique(x)))
Run Code Online (Sandbox Code Playgroud)
之后ndist<-as.data.frame(ndist),我得到了这个:
> head(ndist)
ndist
2005-05-08 3
2005-05-09 4
2005-05-10 6
2005-05-11 4
2005-05-12 6
2005-05-13 6
Run Code Online (Sandbox Code Playgroud)
问题是计数与date_only一起被称为ndist.但是我需要在两个单独的列中使用它们,一个带有count,另一个带有date_only.如何才能做到这一点?我想它相当简单,但我只是不明白.如果你能给我任何想法,我将不胜感激.
谢谢你的努力.
有人可以看出这有什么问题:
library(rgdal)
# Make a two-column matrix, col1 = long, col2 = lat
xy <- cbind(c(-107), c(26))
# Convert it to UTM coordinates (in units of meters)
project(xy, "+proj=utm +zone=51 ellps=WGS84")
Run Code Online (Sandbox Code Playgroud)
我知道纬度大于84且小于80是无效的,但为什么我会得到:
In project(xy, "+proj=utm +zone=51 ellps=WGS84") :
1 projected point(s) not finite
Run Code Online (Sandbox Code Playgroud)
谢谢!