Displaying 20 results from an estimated 22 matches for "ydim".
Did you mean:
dim
2008 May 23
1
Shared Library Error
Can anyone help me resolve this? A part of the R function looks like this:
print(is.loaded('merge_xtabs_patterns_file'))
print(is.loaded('merge_xtabs_patterns_file_'))
.Fortran('merge_xtabs_patterns_file_',ydim[1],ydim[2],x=as.integer(as.matrix(y)),na=as.integer(c),
maxD=as.integer(maxD),lrowmem=length(rowmem),rowmem=as.integer(rowmem),
sequential=as.integer(Sequential),nclust=as.integer(nclust))
The corresponding output:
[1] FALSE
[1] TRUE
Error in .Fortran("merge_xtabs_patterns_file_",...
2006 Aug 03
1
question about dll crashing R
...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 = INTEGER(...
2009 Jul 31
1
write matrix M including names(dimnames(M))
...vising, 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 Nabble.com.
2006 Mar 09
0
When calling external C-function repeatedly I get different results; can't figure out why..
...*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(mode,...
2012 Aug 21
1
ncdf - writing variable to a file
...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,lscalevar,scale,verbose=TRUE )
#scale is an arr...
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, nrx, nc...
2005 Jun 09
1
Help with SOM membership
...atrix 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 calls w...
2005 Apr 19
0
Changes to batchSOM from 1.9.1 to 2.0.1
...er=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.names=T,
row.na...
2006 Oct 24
0
incorrect number of subscriptions error in user-written function
...e 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 sec2,
comb = multiperm(sec1,s...
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 -
2017 Aug 14
2
ncdf4: Why are NAs converted to _FillValue when saving?
...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('Temperature','K', list(xdim,ydim,tdim), mv )
#...
2006 Dec 18
2
surface3d grid from xyz dataframe
...idvalue,height,gridcol 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, Do...
2006 May 09
1
visualisation of Self organising map
Hello R users,
I'm using SOM() to cluster a gene expression data set
the syntax i used was
dataGrid <- c(somgrid(xdim = 3, ydim = 3, topo = c("rectangular","hexagonal")))
dataClusters <- SOM(dataMatrix, grid = dataGrid)
plot(dataClusters)
it seems that this works just fine but the thing i can't figure out is
how to determine where each data point has been clustered.
any suggestions are welcome...
2007 Aug 31
1
Question on shardsplot
Dear All,
Would you please tell me how to display the sample No. on the map ?
---Below commands don't display the sample No.(from 1 to 150).---
library(som)
library(klaR)
iris.som3 <- som(iris[,1:4], xdim = 14,ydim = 6)
library(klaR); opar<- par(xpd = NA)
shardsplot(iris.som3, data.or = iris,label = TRUE)
legend(3.5,14.3, col = rainbow(3), xjust =0.5, yjust = 0,legend =
levels(iris[, 5]),pch = 16, horiz = TRUE)
par(opar)
----------------
Ebi
[[alternative HTML version deleted]]
2017 Aug 14
0
ncdf4: Why are NAs converted to _FillValue when saving?
...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('Temperature','K'...
2005 Feb 04
1
Rare Cases and SOM
...;-matrix(cos(1:10),nrow=900,ncol=10,byrow=TRUE)
InputB<-matrix(sin(5:14),nrow=100,ncol=10,byrow=TRUE)
Input<-rbind(InputA,InputB)
I though that a small grid of 3*3 would be enough to
extract the patterns in such simple matrix :
GridWidth<-3
GridLength<-3
gr <- somgrid(xdim=GridWidth,ydim=GridLength,topo =
"hexagonal")
test.som <- SOM(Input, gr)
par(mfrow=c(GridLength,GridWidth))
for(i in 1:(GridWidth*GridLength))
plot(test.som$codes[i,],type="l")
Only when I use a larger grid (say for example 7*3 ) I
get some of the representatives for the sin pattern.
This...
2011 Dec 05
0
Rggobi pdf output
...imnames(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.som)
d.music.som<-list(Son...
2011 Dec 05
1
[rggobi] ggplot like pdf output
...imnames(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.som)
d.music.som<-list(Son...
2009 Apr 26
7
Bumps chart in R
Hi there,
I would like to make a 'bumps chart' like the ones described e.g.
here: http://junkcharts.typepad.com/junk_charts/bumps_chart/
Purpose: I'd like to plot the proportion of people in select countries
living for less then one USD pr day in 1994 and 2004 respectively. I
have already constructed a barplot - but I think a bumps chart would
be better
# The barplot and data
2010 Mar 22
2
importing .bil files
Dear list
Has anyone got a recipie at hand to import .bil files into R? From
what I understand the .bil files I got contain layered matricies which
I would lke to make available in R as an array or list.
GIS people seem to be familiar with the .bil format but I am not using
any GIS software and would prefer to deal with the data in R.
I use the latest version of R on Mac OSX 10.5.8.