Displaying 20 results from an estimated 2000 matches similar to: "Problem with indexing (subscript out of bounds)"
2006 Oct 12
1
Should NA's in summary() output always be reported???
Consider
> summary(1:5)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1 2 3 3 4 5
> summary(c(1:5,NA))
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
1 2 3 3 4 5 1
Wouldn't it be more stringent if "NA's" was also reported in the first case??
Regards
S?ren
2005 Apr 10
2
residuals in VGAM
Hi all:
I want to fit a multinomial logit model with VGAM package, however I cannot find a way to check the residuals since
residuals(my_model) and resid(my_model)
does not work.
Any suggestions?
Thanks in advance.
Alex Brito
[[alternative HTML version deleted]]
2005 Dec 13
1
sample matrix
Please, I??d like to store this sample matrix as a new object. How can I
do this ?
pulse <- c(67, 67, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70, 70, 71,
71, 72, 72, 73, 74)
m <- NULL
x <- 0
for (i in 1:5)
{
x <- sample(pulse,3)
m <- mean(x)
cat(x,m,"\n")
}
Thanks,
Mauricio
2006 Sep 29
3
if then else
What is the correct form to write statement meaning:
if (a==1) {b=2; c=3}; else {b=0; c=0};
Thank you
Jue Wang, Biostatistician
Contracted Position for Preclinical & Research Biostatistics
PrO Unlimited
(908) 231-3022
2006 Oct 05
1
matrix multiplication
Dear all,
I have 2 matrices, one is a 8x3 matrix, called X; the other matrix is a 3x3 indicator matrix with the diagonal element as 0 or 1. when a variable is included in the model, the corresponding diagonal element is 1, otherwise, it is 0. Let A be a set of matrices that contain the possible indicator matrix. e.g.,
A= [A1, A2, A3],
where A1= [1,0,0;0,0,0,0,0,0],
A2 =[1,0,0;0,1,0,0,0,0],
A3
2006 Oct 05
1
convert day of week from number to character and include in lm
All,
I am trying to include a day of week variable (1-7) in in a regression
model. I would like to have the day of week treated as a categorical
variable rather than a number
the code looks like
lm( dep ~ WKDY)
I know this is a basic question, but help would be appreciated
thanks
spencer
[[alternative HTML version deleted]]
2006 Oct 11
1
extracting rows
Hi,
I have a matrix with few hundred by a few hundred and want to extract rows,
e.g. (0,1,0), or (1.3, 2.4, 4). I made an example:
> A = rep(rep(c(0,1),4),2)
> B = rep(rep(c(0,1),each=4),2)
> C = rep(rep(rep(c(0,1),2),each=2),2)
> X = data.frame(A,B,C,rnorm(16))
A B C
[1,] 0 0 0 0.72767870
[2,] 1 0 0 -0.09673298
[3,] 0 0 1 0.51192790
[4,] 1 0 1 -1.54350441
[5,] 0 1 0
2006 Jul 13
3
set the bahavior that R deal with missing values?
Dear Rusers,
The default behavior in R when performing a regression model with missing
values is to exclude any case that contains a
missing value? How could i set the bahavior that R deal with missing values?
e.g.:
exclude cases listwise
exclude cases pairwise
replace with mean
Thanks very much!
--
Kind Regards,
Zhi Jie,Zhang ,PHD
Department of Epidemiology
School of Public Health
Fudan
2005 Dec 14
2
Append tables
R Help:
I have read a number of tables into R with identical headings and I
would now like to make a single table that has all the data appended
under this single heading line.
for example:
t1 <- read.csv("f1",header=TRUE)
t2 <- read.csv("f2",header=TRUE)
all <- c(t1,t2)
#all is now twice as wide as t1 or t2 with the same number of row!!!!
#I need to know how
2005 Dec 13
2
creating a subset of a dataset using ifelse statement?
I am using R in a Microsoft Windows environment.
I have a dataset called “mp1b”. I have a variable called h.
h can take a value from -1 to 5.
If h <1, I want to create a new dataset called mp2 that is the same as mp1b:
“mp2<-mp1b”
If h > 0, I want to set create a dataset mp2, where I limit the original dataset to those where mp1b$group = =h. similar to:
2007 Jul 18
1
possible bug R CMD check: No space(s) allowed after \VignetteDepends{}
R CMD check gives an error when a vignette entry %\VignetteDepends{} has any
extra space at the end.
Maybe this is by design, but I found it confusing.
Changing the function "vignetteMetaRE" in tools package could solve the
problem. I.e.
vignetteMetaRE <- function(tag)
paste("[[:space:]]*%+[[:space:]]*\\\\Vignette", tag,"\\{([^}]*)\\}", sep
= "")
2005 Dec 14
2
The fastest way to select and execute a few selected functions inside a function
Dear useRs?
I have the following problem! I have a function that calls one or more
functions, depending on the input parameters. I am searching for the fastest
way to select and execute the selected functions and return their results in
a list. The number of possible functions is 10, however usually only 2 are
selected (although sometimes more, even all).
For examples, if I have function
2005 Dec 07
4
Maintaining factors when copying from one data frame to another
Greetings all:
OK, this is bugging the @#@%* out of me. I know the answer is simple
and straightforward but for the life of me I cannot find it in the
documentation, in the archives, or in my notes (because I know I've
encountered this in the past). My problem is:
I have a data frame with columns A, B, C, D, and E. A, B, and E are
factors and C and D are numeric. I need a new data frame with
2011 Apr 29
0
mlogit package, "Error in X[omitlines, ] <- NA : subscript out of bounds"
I am using the mlogit packages and get a data problem, for which I
can't find any clue from R archive.
code below shows my related code all the way to the error
#---------------------------------------------------------------------------
mydata <- data.frame(dependent,x,y,z)
mydata$dependent<-as.factor(mydata$dependent)
mldata<-mlogit.data(mydata, varying=NULL,
2010 Dec 08
1
Error in eval.with.vis(expr, envir, enclos) : subscript out of bounds
I have a for-loop in my code that calls another .R file:
source("estimation.R")
This file runs through without any problems, so the program completes the loop one time. However, when the loop starts a second time and it comes time to call the file "estimation.R" again, program stops and prints the following error message:
"Error in eval.with.vis(expr, envir, enclos) :
2012 Jun 25
1
Arules - predict function issues - subscript out of bounds
Hi,
I'm doing a Market Basket Analysis in which I have a list of transaction
id's in column 2 and transactions(product names) in column 1. I read this
into a transaction file using a
txn<-read.transaction(file="data.csv",format='single', rm.duplicates=F,
cols=c(1,2))
If I want to use the apriori algorithm everything seems to be running fine.
However it is when I want
2010 Mar 14
1
Error in object$tables[[v]] : subscript out of bounds
Hi,
Could you please tell me how I correct the following error message?
“Error in object$tables[[v]] : subscript out of bounds”
This is the code:
library(e1071)
data(iris)
attach(iris)
class_label <- names(iris)[1]
myformula <- formula(paste(class_label,"~ ."))
mymodel<-naiveBayes(myformula, iris,cross=3)
predict(mymodel,iris) ##Error in object$tables[[v]] :
2007 Feb 14
0
[Bug 545] New: Array subscript is above array bounds
https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=545
Summary: Array subscript is above array bounds
Product: iptables
Version: CVS (please indicate
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: ip6tables
AssignedTo: laforge@netfilter.org
2015 Oct 24
0
Bug#802870: xen: FTBFS: error: array subscript is above array bounds
Source: xen
Version: 4.4.1-9+deb8u1
Severity: serious
Justification: fails to build from source
Tags: sid stretch
User: reproducible-builds at lists.alioth.debian.org
Usertags: ftbfs
X-Debbugs-CC: reproducible-builds at lists.alioth.debian.org
Dear Maintainer,
The package fails to build:
symbols.c: In function ?symbols_lookup?:
symbols.c:23:61: error: array subscript is above array bounds
2006 Oct 18
2
Error: subscript out of bounds (PR#9305)
Full_Name: Steven King
Version: 1.16
OS: OSX vesion 10.4.8
Submission from: (NULL) (71.126.161.149)
Setting a matrix is a function - the failure occurs only on 2 X 2 matrices.
x<-matrix(1:4,nrow=2)
> x
[,1] [,2]
[1,] 1 3
[2,] 2 4
> x[x]<-2
Error: subscript out of bounds