similar to: Object of type 'closure' not subsettable

Displaying 20 results from an estimated 800 matches similar to: "Object of type 'closure' not subsettable"

2009 Dec 20
1
Problem with sequence in loop
Hi all, I've got a list of files from 1914 to 2000. For each file, I can call the read.table function as follows. > file <- read.table("1914.txt") But I want to make a script so that at the end of the loop, the script selects the file 1915.txt, 1916.txt and so on. I've used seq() to create the increment seq <- paste(seq(1914, 2006, by=1), "*.txt.h",
2010 Jan 14
1
Error: object of type 'closure' is not subsettable
Hi everyone, Would somebody please explain (or point me to a reference that explains) the following error: "Error: object of type 'closure' is not subsettable" I was trying to use rep() to replicate a function: > example_function <- function() { return(TRUE) } > rep(example_function, 3) Error: object of type 'closure' is not subsettable But I just cannot
2011 Aug 18
3
Error message: object of type 'closure' is not subsettable
Dear R-users I need to calibrate kappa, rho, eta, theta, v0 in the following code, see below. However when I run it, I get: y <- function(kappahat, rhohat, etahat, thetahat, v0hat) {sum(difference(k, t, S0, X, r, implvol, q, kappahat, rhohat, etahat, thetahat, v0hat)^2)} > nlminb(start=list(kappa, rho, eta, theta, v0), objective = y, lower =lb, > upper =ub) Error in dots[[1L]][[1L]] :
2010 Mar 19
1
Sweave and " object of type 'closure' is not subsettable" error
Hello folks: I have a data frame which includes two numeric vectors: "Pa1" and "Ingr" (which represents income).  I run the following code on the R console: ingreso <- factor(ifelse(Ingr<=3000,"bajo","alto")) tapply(Pa1,ingreso,summary) boxplot(Pa1~ingreso) and it works fine.  However, when I "Sweave" through an rnw file containing that
2009 Dec 30
2
select elements and transpose
Hi all, Given the following, > xx [[1]] V1 V2 V3 [1,] 1 2 3 [2,] 4 5 6 [3,] 7 8 9 [[2]] V1 V2 V3 [1,]10 11 12 [2,]13 14 15 [3,]16 17 18 [[3]] V1 V2 V3 [1,]19 20 21 [2,]22 23 24 [3,]25 26 27 how do i extract elements in each file so that after transpose, it looks something like the following; 1 10 19 2 11 20 3 12 21 and so on.. Thanks.. -- Muhammad
2009 Dec 04
2
Standard deviation for each element in a set of matrices
Hello R-users, I would like to know how to find the standard deviation for each element in a set of matrices. Given the following files, File1 File2 File3 1 1 1 4 4 4 7 7 7 2 2 2 5 5 5 8 8 8 3 3 3 6 6 6 9 9 9 I want to calculate the standard deviation for every cell in the file (I'm using gridded data). The desired output is Output 3 3 3 3 3
2010 Jan 02
1
Question on Reduce + rollmean
Hello useRs, I'd like to perform a moving average on the dataset, xx. I've tried combining the functions Reduce and rollmean but it didn't work. > r <- function(n) rollmean(n, 2) # where 2 = averaging interval > output < - Reduce("r", x) Error in f(init, x[[i]]) : unused argument(s) (x[[i]]) Is there anything wrong with the code in the first place? where
2013 Mar 14
1
error: object of type 'closure' is not subsettable
Hi all, when i run this script: >read.table("Angelika.txt",header=T,sep="\t") >mytable=read.table("Angelika.txt",header=T,sep="\t") >for ( dye in c("A","B","C","F","G","K","L","M")) + { + for (cond in 1:8) + { + measurement =
2009 Dec 27
3
Scaling error
Hi useRs, I ran into an inconsistent output problem again. Here is the simplify illustration I've got a matrix as follows > x V1 V2 V3 [1,] 1 2 3 [2,] 4 5 6 [3,] 7 8 9 Associated with the matrix is a scaling factor, sca, derived from, say the mean of the respective columns, V1-V3; > sca V1 V2 V3 2.5 1.7 3.6
2010 Jan 16
2
Drought severity index: Excel to R
Dear all, I'm trying to make an R code for the drought severity index (DSI) developed by Philips and McGregor (1998). You can refer to the description of the algorithm on page 19 from http://dissertations.port.ac.uk/229/01/MaloneS.pdf The code is given in Excel as the following and can be found on page 60 from the same link. C7 = IF(C6<0,IF(@SUM(A6:A1)<0,C6+A6,"0"),
2009 Dec 07
1
Output multiple files
Hello, I want the ouput to take the name of the original file. I have the following code - but the problem is that the output overrides the original file which I desire not. So given an input file called File1.txt, I want the ouput to be called File1.out.txt, or something along this line. I'm working with many files, fyi. out=c("file1.txt", "file2.txt",
2010 Jan 06
1
Increment in loop
useRs, I'm getting limited success in trying to apply increment in a loop. The following defined function creates a +1 increment incr <- function(x){ eval.parent(substitute(x <- x + 1)) print(x) } How do I apply it in a loop on my test dataset, x1, so that the procedure becomes x1[c(1:2)] x1[c(2:3)] x1[c(3:4)] where x1 = > m <- matrix(1:3,3,3) > x1 <- list(m, m+1,
2009 Dec 02
2
Arithmetic on multiple files
Dear R-users, I'd like to perform arithmetic functions on 1000 files containing a 2000x2000 matrix. Can anyone advise? For example, File1 File2 Output 1 1 1 4 4 4 5 5 5 2 2 2 + 5 5 5 = 7 7 7 3 3 3 6 6 6 9 9 9 Muhammad -- Muhammad Rahiz | Doctoral Student in Regional Climate Modeling Climate Research
2011 Sep 24
2
ncdf - install error
Dear all, I'm having issues with the installation of the ncdf package. It returns a non-zero exit status. Can anyone suggest what I should do next? FYI, I do not have problems installing other packages. Thanks. Muhammad * installing *source* package ?ncdf? ... checking for nc-config... /usr/local/bin/nc-config configure: creating ./config.status config.status: creating src/Makevars **
2012 Nov 27
1
Problem in Starting R Server - object of type 'closure' is not subsettable
Hi All, I am trying to start R Server to run some Java Script in my local machine using the library, 'Rook'. I use Windows 7. And my codes are following, > library(Rook) > myD3dir <- 'D:\\STUDIES\\Java script\\d3-master' > s <- Rhttpd$new > s$start(quiet=TRUE) and i get the following error for the above line, Error in s$start : object of type
2011 Apr 11
0
Package fgui returns error: Object of type closure is not subsettable
Hello All, I have written three functions. First: To input user specified SAS dataset and plot the boxplots of relevant variables. Second: Extract the number of hours, minutes etc. from a variable describing a time-point using regular expressions. E.g. 'Per1, Day 2, 24 Hour' would be separated into three columns, Per (value 1), Day (value 2) and Hour (value 24) Third:
2010 Jan 12
1
Drought Severity Index (DSI)
Does anyone have the code to calculate the drought severity index? -- Muhammad Rahiz | Doctoral Student in Regional Climate Modeling Climate Research Laboratory, School of Geography & the Environment Oxford University Centre for the Environment, University of Oxford South Parks Road, Oxford, OX1 3QY, United Kingdom Tel: +44 (0)1865-285194 Mobile: +44 (0)7854-625974 Email: muhammad.rahiz
2009 Dec 26
1
if else does not return right value
Hi all, I'm not getting the right results for values that are >99 using the if else function. The following illustrates the problem > x <- as.matrix(read.table("test.txt")) > x V1 V2 V3 [1,] 47 1 43 [2,] 83 2 42 [3,] 1 3 41 [4,] 39 4 40 [5,] 23 5 39 [6,] 23 6 38 [7,] 39 7 37 [8,] 32 8 36 [9,] 73 9 35 [10,] 124 10 34 Specifying the
2006 Sep 13
1
Updating lmer - object is not subsettable?
I'm attempting to write a general function to implement Faraway's bootstrapping algorithm for mixed models with lmer, but have run into a curious problem. I'm comparing two models model.1<-lmer(Response ~ Treatment + (1|Trial), data=exp.data, method="ML") model.2<-lmer(Response ~ 1 + (1|Trial), data=exp.data, method="ML") When I attempt to update
2012 Apr 03
1
object of type 'S4' is not subsettable
hey there! The object 'cit' contains: > cit ##################################################### # Johansen-Procedure Unit Root / Cointegration Test # ##################################################### The value of the test statistic is: 5.3484 9.0681 10.6433 --------------- I want R to save the value 5.3484 in a new object. I am used to use the command x=cit[a] where a