search for: nm1

Displaying 20 results from an estimated 23 matches for "nm1".

Did you mean: m1
2007 Mar 09
1
lpSolve space problem in R 2.4.1 on Windows XP
...MIP formulation to work correctly on some very small problems (~10 variables and 25 constraints). Here is the code for a working example: >library(lpSolve) >(v1=rev(1:8)) [1] 8 7 6 5 4 3 2 1 >(csv1=cumsum(as.numeric(v1))) [1] 8 15 21 26 30 33 35 36 >(lencsv1=length(csv1)) [1] 8 >(Nm1=lencsv1-1) [1] 7 >(Np1=lencsv1+1) [1] 9 >ngp=3 >f.obj=c(1,1,rep(0,Nm1)) >f.int=3:Np1 >bin.con=cbind(rep(0,Nm1),rep(0,Nm1),diag(Nm1)) >bin.dir=rep("<=",Nm1) >bin.rhs=rep(1,Nm1) >gp.con=c(0,0,rep(1,Nm1)) >gp.dir="<=" >(gp.rhs=ngp-1) [1] 2 >ub...
2007 Jul 12
1
sub-function default arguments
Hi. I have defined a function, f1, that calls another function, f2. Inside f1 an intermediate variable called nm1 is created; it is a matrix. f2 takes a matrix argument, and I defined f2 (schematically) as follows: f2<-function(nmArg1=nm1,...){nC<-ncol(nmArg1); ... } so that it expects nm1 as the default value of its argument. f1 is defined (schematically) as: f1<-function(...){result1<-f2()...
2009 Sep 20
4
correlation help
Dear group, I have a matrix like the following: Name Sample1 sample2 sample3 sample4 ..... sample(n) nm1 10.5 13.5 30 31 nm2 8 11 34 29 nm3 9 10.3 27.8 35 nm(j) I want to be able to calculate correlation between all pairs of names. For example (nm1,nm2), (nm1,nm3), (nm1,nmj), (nm2,...
2009 Mar 13
2
Taking diff of character vectors
Hello, everybody Say I have nm1 <- c(rep(1,10), rep(0,10)) then I can do: diff(nm1) to see where I have shift in value but what if I have nm2 <- c(rep("SPZ8", 10), rep("SPX9", 10)) how can I produce the same ouput as diff(nm1) does, that is zeros everywhere except for one place where SPZ8 changes to SP...
2016 Dec 20
2
colnames for data.frame could be greatly improved
...# int in range [1,5] v2 = sample(5, N, TRUE), # int in range [1,5] v3 = sample(round(runif(100,max=100),4), N, TRUE) # numeric e.g. 23.5749 ) cat("GB =", round(sum(gc()[,2])/1024, 3), "\n") #GB = 0.397 colnames(DF) = NULL system.time(nm1<-colnames(DF, FALSE)) # user system elapsed # 22.158 0.299 22.498 print(nm1) #[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" ### restart R colnames <- function (x, do.NULL = T...
2004 Jun 09
1
Re: R equivalent of Splus rowVars function
...R question. -- -- David Brahm (brahm at alum.mit.edu) colVars <- function(x, na.rm=FALSE, dims=1, unbiased=TRUE, SumSquares=FALSE, twopass=TRUE) { if (SumSquares) return(colSums(x^2, na.rm, dims)) N <- colSums(!is.na(x), FALSE, dims) Nm1 <- if (unbiased) N-1 else N if (twopass) {x <- if (dims==length(dim(x))) x - mean(x, na.rm=na.rm) else sweep(x, (dims+1):length(dim(x)), colMeans(x,na.rm,dims))} (colSums(x^2, na.rm, dims) - colSums(x, na.rm, dims)^2/N) / Nm1 } rowVars <- function(x, na.rm=FALSE,...
2016 Dec 27
0
colnames for data.frame could be greatly improved
...; v2 = sample(5, N, TRUE), # int in range [1,5] > v3 = sample(round(runif(100,max=100),4), N, TRUE) # numeric e.g. 23.5749 > ) > cat("GB =", round(sum(gc()[,2])/1024, 3), "\n") > #GB = 0.397 > colnames(DF) = NULL > system.time(nm1<-colnames(DF, FALSE)) > # user system elapsed > # 22.158 0.299 22.498 > print(nm1) > #[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" > > ### restart R > > c...
2002 Nov 15
2
Why no colSDs etc
Hi people, If there is a fn "colMeans" why isn't there a "colSDs" etc Thanks, Phil. -- Philip Rhoades Pricom Pty Limited (ACN 003 252 275) GPO Box 3411 Sydney NSW 2001 Australia Mobile: +61:0411-185-652 Fax: +61:2:8923-5363 E-mail: pri at chu.com.au -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2002 Aug 14
3
t-test via matrix operations
I need to calculate a large number of t statistics, and would like to do so via matrix operations. So far I have figured out a way to calculate the mean of each row of the matrix: d <- matrix(runif(100000,1,10), 1000, 10) # some test data s <- rep(1,ncol(d)) # a sum vector to use for matrix multiplication means <- (d%*%s)/ncol(d) This is at least 1 order of magnitude faster than
2006 Mar 31
2
rowVars
I am using the R 2.2.1 in a Windows XP environment. I have a dataframe with 12 columns and 1,000 rows. (Some of the rows have 1 or fewer values.) I am trying to use rowVars to calculate the variance of each row. I am getting the following message: ?Error in na.remove.default(x) : length of 'dimnames' [1] not equal to array extent? Is there a good work-around?
2011 Oct 17
1
plotting issues with PCA
...y colour file correctly and is only printing the first colour in the file....code is below site.codings <- c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,5,4,4,4,4,4,3,3,3,6,6,6,6,6,6,6,6,5,5,5,5) > names(site.codings) <- c( "WM1", "WM2", "WM3", "NM1", "NM2", "NM3", "KH1", "KH2", "KH3", "LM1" ,"LM2" ,"LM3", "DB1" ,"DB2" ,"DB3", "DM1" , "DM2" , "DM3" , "FI1", "FI2", "BKI1&quot...
2002 Mar 17
5
compute variance of every column in a matrix without a loop
Is it possible to compute the variance of every column in a matrix without a loop? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2017 Feb 22
0
Crash in the latest release
...e4_1.1-12 Matrix_1.2-8 loaded via a namespace (and not attached): [1] minqa_1.2.4 MASS_7.3-46 compiler_3.4.0 tools_3.4.0 [5] Rcpp_0.12.9 splines_3.4.0 nlme_3.1-131 grid_3.4.0 [9] nloptr_1.0.4 lattice_0.20-34 > startvec <- c(Asym = 200, xmid = 725, scal = 350) > (nm1 <- nlmer(circumference ~ SSlogis(age, Asym, xmid, scal) ~ Asym|Tree, + Orange, start = startvec)) *** Error in `/usr/local/src/R-devel/bin/exec/R': malloc(): memory corruption: 0x0e3df988 *** Aborted (core dumped) --------------------- The valgrind version is interesting too:...
2017 Feb 22
0
[Lme4-authors] Crash in the latest release
...t; loaded via a namespace (and not attached): > [1] minqa_1.2.4 MASS_7.3-46 compiler_3.4.0 tools_3.4.0 > [5] Rcpp_0.12.9 splines_3.4.0 nlme_3.1-131 grid_3.4.0 > [9] nloptr_1.0.4 lattice_0.20-34 > >> startvec <- c(Asym = 200, xmid = 725, scal = 350) >> (nm1 <- nlmer(circumference ~ SSlogis(age, Asym, xmid, scal) ~ Asym|Tree, > + Orange, start = startvec)) > *** Error in `/usr/local/src/R-devel/bin/exec/R': malloc(): memory > corruption: 0x0e3df988 *** > Aborted (core dumped) > > --------------------- > > The...
2005 Jul 24
1
Buglet in src/appl/splines.c (PR#8030)
...patch" Content-Transfer-Encoding: 7bit Index: src/appl/splines.c =================================================================== --- src/appl/splines.c (revision 35020) +++ src/appl/splines.c (working copy) @@ -348,6 +348,7 @@ int i, j, k, l; double ul, dx, tmp; + const int nm1 = *n - 1; if(*method == 1 && *n > 1) { dx = x[*n - 1] - x[0]; @@ -365,7 +366,7 @@ i = 0; for(l = 0; l < *nu; l++) { ul = v[l]; - if(ul < x[i] || x[i+1] < ul) { + if(ul < x[i] || (i < nm1 && x[i+1] < ul)) { i = 0; j = *n; do...
2009 Dec 09
4
binary string conversion to a vector (PR#14120)
Full_Name: Franc Brglez Version: R 2.9.1 GUI 1.28 Tiger build 32-bit (5444) OS: MacOSX -- 10.6.2 Submission from: (NULL) (24.148.163.114) I am demonstrating what may be a bug or my lack of experience. Please review as it would help to hear from someone. MANY THANKS -- Franc Brglez The function "binS2binV" returns what I consider a wrong value -- see the terminal output binS2binV =
2010 Apr 05
0
[LLVMdev] Linking with C Library
...iler. It outputs the following: > > 08161b00 T camlRuntime__rt_fputs_208 > 08161a20 T camlRuntime__rt_puts_198 >        U fputs > > I'm assuming this means that fputs is linked dynamically, and puts is not. Don't assume; ask `man nm`. http://www.linuxcommand.org/man_pages/nm1.html says that a 'U' in that column means "The symbol is undefined." (It's there so the dynamic loader knows to pull it out of a .so, I think.) You need to figure out how to pass -rdynamic to the linker, like I said before. http://llvm.org/docs/tutorial/OCamlLangImpl7.html me...
2010 Apr 05
2
[LLVMdev] Linking with C Library
I tried running nm - D | grep "puts" on the binary compiled by the OCaml compiler. It outputs the following: 08161b00 T camlRuntime__rt_fputs_208 08161a20 T camlRuntime__rt_puts_198 U fputs I'm assuming this means that fputs is linked dynamically, and puts is not. I tried modifying my code to use fputs instead of puts instead, but had no success, however, I still get:
2010 Jan 12
2
optimization challenge
I have a challenge that I want to share with the group. This is not homework (but I may assign it as such if I teach the appropriate class again) and I have found one solution, so don't need anything urgent. This is more for fun to see if others can find a better solution than I did. The challenge: I want to read a book in a given number of days. I want to read an integer number of
2013 Sep 05
6
[PATCH 1/7] drm/nouveau: remove prototype for non-existent nouveau_connector_bpp
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- drivers/gpu/drm/nouveau/nouveau_connector.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h index 6e399aa..4cefce3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.h +++ b/drivers/gpu/drm/nouveau/nouveau_connector.h @@ -107,7 +107,4