Displaying 3 results from an estimated 3 matches for "restrictedparts".
2012 Jan 25
1
function restrictedparts
I am using function restrictedparts, but got error:
restrictedparts(281,10)
Error in integer(len) : vector size specified is too large
Calls: restrictedparts -> integer
In addition: Warning message:
In restrictedparts(281, 10) : NAs introduced by coercion
Error in integer(len) : vector size specified is too large
Calls: restrict...
2012 Jun 01
1
R Error : Error in vector("list", gamma(n + 1)) : vector size specified is too large
Dear R-listers,
I am giving part of my R code :
###########################################################
n=15
m=1
library("partitions")
library("gregmisc")
library("combinat")
x = t(restrictedparts(n-m,m))
l = length(x[,1])
for(u in 1:l){
A= unique(matrix( unlist(permn(x[u,])), ncol=m, byrow=TRUE ))
}
###########################################################
when I put m=1 error shows : Error in vector("list", gamma(n + 1)) :
vector size specified is too large . But it...
2006 Aug 30
4
Create a vector from another vector
Dear list
Suppose I have the following vector:
x <- c(3,4,2,5,6)
Obviously, this sums to 20. Now, I want to have a second vector, call it
x2, that sums to x where 5 <= x <= 20, but there are constraints.
1) The new vector must be same length as x
2) No element of the new vector can be 0
3) Element x2[i] of the new vector cannot be larger than element x[i] of
the original vector
4)