全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1556 1
2012-12-18
library(MASS,T)
library(splines)
library(chron)

## Function to create circular splines
###############################################################################
bc <- function(x, period = 24., degree = 3., nknots = 6.)
{
if(any(x < 0. | x >= period))
stop("x out of bound")
if(degree < 1.)
stop("degree must be a positive integer")
knots.x <- seq(0., period, length = nknots + 1.)
delta <- diff(knots.x[1.:2.])
knots.left <- seq(from =  - delta, by =  - delta, length = degree)
knots.right <- seq(from = period + delta, by = delta, length = degree)
knots <- c(knots.left, knots.x, knots.right)
X <- spline.des(x = x, knots = knots, ord = degree + 1.)$design
X[, 1.:degree] <- X[, 1.:degree] + X[, ncol(X) - (degree - 1.):0.]
X <- X[, 1.:(ncol(X) - degree)]
return(X)
}

cc <- c("character",rep("numeric",6),"factor","Date","numeric",
        "numeric","factor","numeric","character")
testdata <- read.table(file="C:/Ddrive/a/a.txt",
                       header=TRUE,colClasses=cc)
错误于scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
  scan()需要'a real', 而不是'--'
这个如何解决?出了什么问题?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-12-18 23:31:46
这是读数据是出现的问题。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群