search for: xdim

Displaying 20 results from an estimated 33 matches for "xdim".

Did you mean: dim
2001 Oct 03
1
package GeneSOM ?
Hello Rprofessionals, The SOM-Obj works very well, when i normalize my data and the plot-function, too ! But i miss or didn't find the possibility , extract the information from the SOMplot "clusterSize" and "mean" for every cluster as quantitative information ( i.e. the DataFrame with an additional column which define the calculate clusters from SOM)? My intention -
2006 Aug 03
1
question about dll crashing R
...inside foobar and run the main code routine more than 100 times, it crashes R. Or if I call .Call("foobar"....) seperately more than two tims it crashes R. For the most part I am doing matirx multiplies using EXP matrixprod (SEXP x , SEXP y ) { int nrx , ncx , nry , ncy , mode; SEXP xdims , ydims , ans ; char *transa = "N" , *transb = "N" ; double one = 1.0 , zero = 0.0 ; xdims = getAttrib (x , R_DimSymbol ) ; ydims = getAttrib (y , R_DimSymbol ) ; mode = REALSXP; nrx = INTEGER( xdims ) [ 0 ] ; ncx = INTEGER( xdims ) [ 1 ] ; nry = INTEGER( ydims ) [ 0 ] ; ncy =...
2009 Nov 30
3
bug or bizarre feature?
Hello, I'm running into a very strange problem: > xrange <- c(-2.5,2.5) > xdim <- 100 > mobility <- 0.1 > slope <- 1.16 > urange <- slope*xrange > udim <- max(slope*xdim,5) > du <- (urange[2]-urange[1])/udim > uvec <- urange[1]+(1:udim-0.5)*du > # type dependent weight function > ckern <-...
2010 Apr 23
2
3D Plot
Hi guys of the R-Help-Team!<br /><br />First of all - you do a great job!<br />I've found a lot of your mails in the internet. So I thought it would be a good idea to ask you a question about R.<br /><br />R is new to me, so sorry, if the question is too simple :)<br /><br />I have a matrix.<br />I can make a 2D Heatmap of this matrix.<br
2009 Jan 06
1
C dll compilation + S Poetry example
...e quadratic form x'Qx: static double quad_form(double *Q, double *x, long n) { long i, j, ij; double ans = 0.0; for(i=0; i < n; i++) { for(j=0, ij = i * n; j < n; j++, ij++) { ans = ans + x[i] * Q[ij] * x[j]; } } return(ans); } void quad_form_Sp(double *Q, double *x, long *xdim, double *ans) { long i, ii, n; double quad_form(double*, double*, long); n = xdim[0]; for(i=0, ii=0; i < xdim[1]; i++, ii += n) { ans[i] = quad_form(Q, x + ii, n); } } The dll was compiled (in Win XP, R-2.8.1) using the command: rcmd SHLIB qform.c. Then in R I typed: > dyn.load(&quo...
2011 Dec 05
0
Rggobi pdf output
...+1]<-"Map 1" dimnames(x.ggobi)[[2]][ncols+2]<-"Map 2" x.grid<-cbind(x.som$code,x.som$code.sum[,1:2]) dimnames(x.grid)[[2]]<-dimnames(x.ggobi)[[2]] x.clust<-rbind(x.ggobi,x.grid) } f.ggobi.som.net<-function(x.som) { x.net<-NULL for (i in 1:x.som$xdim) { for (j in 1:x.som$ydim) { if (j<x.som$ydim) x.net<-rbind(x.net,c((i-1)*x.som$xdim+j,(i-1)*x.som$xdim+j+1)) if (i<x.som$xdim) x.net<-rbind(x.net,c((i-1)*x.som$xdim+j,i*x.som$xdim+j)) } } return(x.net) } d.music.som<-f.ggobi.som(d.music.std[,-c(1,2)],music....
2011 Dec 05
1
[rggobi] ggplot like pdf output
...+1]<-"Map 1" dimnames(x.ggobi)[[2]][ncols+2]<-"Map 2" x.grid<-cbind(x.som$code,x.som$code.sum[,1:2]) dimnames(x.grid)[[2]]<-dimnames(x.ggobi)[[2]] x.clust<-rbind(x.ggobi,x.grid) } f.ggobi.som.net<-function(x.som) { x.net<-NULL for (i in 1:x.som$xdim) { for (j in 1:x.som$ydim) { if (j<x.som$ydim) x.net<-rbind(x.net,c((i-1)*x.som$xdim+j,(i-1)*x.som$xdim+j+1)) if (i<x.som$xdim) x.net<-rbind(x.net,c((i-1)*x.som$xdim+j,i*x.som$xdim+j)) } } return(x.net) } d.music.som<-f.ggobi.som(d.music.std[,-c(1,2)],music....
2009 Jul 31
1
write matrix M including names(dimnames(M))
...according to some format of my own devising, but I'm wondering if there is a built-in way to write and then restore a matrix with not only the dimnames (which write.table/read.table can preserve) but also the names(dimnames)? Example: > M <- matrix(1:4, 2, 2) > dimnames(M) <- list(xdim=c("a", "b"), ydim=c("u", "v")) > M ydim xdim u v a 1 3 b 2 4 -- View this message in context: http://www.nabble.com/write-matrix-M-including-names%28dimnames%28M%29%29-tp24750637p24750637.html Sent from the R help mailing list archive at Nabbl...
2010 Feb 06
1
duplicating records
Dear friends, I need to fill in (duplicate the whole record) the missing days with the same record values as long as AE is the same value (i.e. "1"), once AE value changes, the process of duplication should proceed with the new AE value till it changes again. e.g. I need to fill in records: day 18-day 44, all the records are carried with the new AE value of "0". At the
2006 Mar 09
0
When calling external C-function repeatedly I get different results; can't figure out why..
...char *transa = "N", *transb = "N"; double one = 1.0, zero = 0.0; F77_CALL(dgemm)(transa, transb, &nrx, &ncy, &ncx, &one, x, &nrx, y, &nry, &zero, z, &nrx); } SEXP trProd2(SEXP x, SEXP y) { int nrx, ncx, nry, ncy, mode, i; SEXP xdims, ydims, ans, ans2, tr; xdims = getAttrib(x, R_DimSymbol); ydims = getAttrib(y, R_DimSymbol); mode = REALSXP; nrx = INTEGER(xdims)[0]; ncx = INTEGER(xdims)[1]; nry = INTEGER(ydims)[0]; ncy = INTEGER(ydims)[1]; PROTECT(ans = allocMatrix(mode, nrx, ncy)); PROTECT(ans2 = allocMatrix...
2006 Oct 24
0
incorrect number of subscriptions error in user-written function
...Loading gtools I can generate the combinations for each selection sec1 = combinations(4,2,1:4) sec2 = combinations(6,3,5:10) sec3 = combinations(8,5,11:18) I then wrote a function to combine the combinations for each selection. multiperm <-function(x, y) # function to combine combinations { xdim = nrow(x) xcol = ncol(x) ydim = nrow(y) ycol = ncol(y) v1 = matrix( nrow = xdim*ydim, ncol = xcol+ycol ) for ( i in 1:xdim) { for (j in 1:ydim){ v1[i + (j-1)*xdim , ] = c(x[i,], y[j, ])} } v1 = data.frame(v1) # set output as dataframe } This works fine when combining sec1 and s...
2012 Aug 21
1
ncdf - writing variable to a file
Hello, I have a problem writing a variable to an existing file. Below is a part of my script and how it fails. I can't find "create.var.ncdf" in help Thanks for any help. Mark nc <- open.ncdf(ncname, readunlim=FALSE, write=TRUE ) missing <- 1.e+30 xdim <- nc$dim[["west_east"]] ydim <- nc$dim[["south_north"]] tdim <- nc$dim[["Time"]] lscalevar <- var.def.ncdf(scalenames[ivar], 'gpoints', list(xdim,ydim,tdim), missing ) nc <- var.add.ncdf( nc, lscalevar ) for( i in 1:nt) put.var.ncdf(nc,lscal...
2008 Jun 12
3
Problem with Freq function {prettyR}
Dear list, I have a problem with freq from prettyR. Please have a look at my syntax with a litte example: library(prettyR) #Version 1 test.df<-data.frame(q1=sample(1:4,8,TRUE), gender=sample(c("f","m"),8,TRUE)) test.df freq(test.df) #No error message #Version 2 test.df<-data.frame(gender=sample(c("f","m"),8,TRUE), q1=sample(1:4,8,TRUE)) test.df
2006 Mar 09
0
When calling external C-function repeatedly I get differentresults; can't figure out why..
...= "N"; > double one = 1.0, zero = 0.0; > F77_CALL(dgemm)(transa, transb, &nrx, &ncy, &ncx, &one, > x, &nrx, y, &nry, &zero, z, &nrx); } > > SEXP trProd2(SEXP x, SEXP y) > { > int nrx, ncx, nry, ncy, mode, i; > SEXP xdims, ydims, ans, ans2, tr; > xdims = getAttrib(x, R_DimSymbol); > ydims = getAttrib(y, R_DimSymbol); > mode = REALSXP; > nrx = INTEGER(xdims)[0]; > ncx = INTEGER(xdims)[1]; > nry = INTEGER(ydims)[0]; > ncy = INTEGER(ydims)[1]; > PROTECT(ans = allocMatrix(mode,...
2007 Aug 07
3
saving output
I have a question about how to save the output of a logistic regression model in some format (delimited, preferably) so that I can manipulate it to make nice tables in excel. I have tried print, save, write, none seem to do what I want them to. Does anyone have any ideas? Lynn D. Disney, Ph.D., J.D., M.P.H. Research Analyst SEIU 1199 1771 E. 30th Street Cleveland, Ohio 44114 Telephone:
2005 Jun 09
1
Help with SOM membership
...iginal matrix was 22283 x 8. The 8 samples have 4 controls and 4 experimentals. I transposed the matrix so that its dim are 8 x 22283, and called that "allt." Using the normalize() function from som library, I scaled the data to have mean zero and variance 1. allt.som <- som(allt, xdim=5, ydim=5, topol="hexa", neigh="bubble", alpha=1) plot(allt.som) What I cannot figure out how to do is how to determine where each sample has clustered, since the plot that i'm using does not include labels...I also tried str(allt.som) but cannot determine which attribute...
2002 Dec 18
2
meta analysis
Dear R-lister, is there any function for Meta Analysis in R? (like homogeneity an, risk differences, relative riskm amd odds ratios? Many thanks, Edwin
2005 Apr 19
0
Changes to batchSOM from 1.9.1 to 2.0.1
...p", header=TRUE, sep=",") # keep only nonzero variance properties rdata <- rdata[, apply(rdata, 2, function(x)any(x[-1] != x[-length(x)])), drop = FALSE] # load SOM package library(class) #set seed for rng set.seed(12345) # calculate SOM gridtopo <- "hexagonal" xdim <- 5 ydim <- 5 gr <- somgrid(xdim = xdim, ydim = ydim, topo = gridtopo) rdata.som <- batchSOM(rdata, gr, c(4, 4, 2, 2, 1, 1, 1, 0, 0)) # write SOM results to stdout rdata.som # write out results write.table(rdata.som$codes, file="c:/temp/A8F.tmp", sep=",", col.nam...
2017 Aug 14
2
ncdf4: Why are NAs converted to _FillValue when saving?
...he ? in my eye ? strange behavior. Thanks for any explanation. Kind regards Raphael Minimal working example (adapted from netcdf4 manual): library(ncdf4) #---------------- # Make dimensions #---------------- xvals <- 1:360 yvals <- -90:90 nx <- length(xvals) ny <- length(yvals) xdim <- ncdim_def('Lon','degreesE', xvals ) ydim <- ncdim_def('Lat','degreesE', yvals ) tdim <- ncdim_def('Time','days since 1900-01-01', 0, unlim=TRUE ) #--------- # Make var #--------- mv <- 1.e30 # missing value var_temp <- ncvar_def(...
2006 Dec 18
2
surface3d grid from xyz dataframe
...as variables of the dataframe. The grid dimensions are 1253 x 2001 (=2507253 data points). My attempts with surface3d fail, mainly because I cannot produce the matrix required for the height input. elev.to.list{CTFS} fails with: "Error in matrix(elevfile$elev, nrow= 1+ydim/gridsize, ncol=1+xdim/gridsize. : attempt to set an attribute on NULL" which I assume means it requires a square grid (=quadrates). Any ideas/help appreciated Thanks Herry Dr Alexander Herr Spatial and statistical analyst CSIRO, Sustainable Ecosystems Davies Laboratory, University Drive, Douglas, QLD 4814 Priva...