Displaying 20 results from an estimated 30000 matches similar to: "question on indexing of a matrix"
2004 Feb 09
5
simple question on picking out some rows of a matrix/data frame
Hi,
I have a simple question about matrix/data frame manipulation. I have
a data frame that looks a something like this
X Y Z
1 0 "apples"
-1 -1 "oranges"
...
0 -1 "bananas"
and I'd like to pull out all the rows for which X and Y are (un)equal
into a submatrix.
How can I do that?
Many thanks,
Roger Levy
2003 Aug 12
4
print points from a huge matrix
Hi All,
I have a 8000*8000 matrix and I want to print out a file with the row name,
column name and the value for those point with values satisfying a condition.
I tried using a for loop, however, it took me forever to get the result. Is
there a fast way to do this? Thanks!
Bing
---------------------------------
1060 Commerce Park
Oak Ridge National Laboratory
P.O. Box 2008, MS 6480
Oak
2003 Apr 02
7
Index of item in matrix
Hello All,
Is there a fast way to find the index(row and column) of a point in a
matrix?
Thanks,
John.
--
--------------------------------------------------------------------------
Dr. John Janmaat
Department of Economics, Acadia University, Wolfville, NS, B4P 2R6
E-mail: jjanmaat at acadiau.ca Web: http://ace.acadiau.ca/~jjanmaat
Tel: 902-585-1461 Fax: 902-585-1070
2004 Aug 18
5
labeled break statements in R?
Hi,
Are there labeled break statements in R? i.e., something along the
lines of
TOPLOOP: for(i in 1:m) {
for(j in 1:n) {
...
if(condition) {
break TOPLOOP
}
}
}
Thanks,
Roger
2004 Sep 22
2
dot density maps
Dear All,
In the moment i'm using the map and maptools package to read shapefiles
and display the maps.
I'm looking for the possibility to draw points (randomly positioned or
positioned according to a grid) into the polygons instead of filling the
polygons with colors.
For example:
a map (shapefile) with 10 countries, 15 points in the polygon of country
A, 20 points in the
2003 Aug 20
2
grid Graphics by Paul Murrell
Dear All,
I've been trying to format a plot output using par() with mfrow, fin,
mai, etc and basically it's proving to be a pain. I searched on google
and found that Paul Murrell had written a grid Graphics program which
seems perfect. However, when I try and use say viewport() I just get a
function not found error. Can someone tell me what I'm doing wrong please?
Thank-you
2007 Oct 12
3
no visible binding
Could someone advise me about how to react to the message:
* checking R code for possible problems ... NOTE
slm: no visible binding for global variable 'response'
from R CMD check SparseM with
* using R version 2.6.0 Under development (unstable) (2007-09-03 r42749)
The offending code looks like this:
"slm" <-
function (formula, data, weights, na.action, method =
2004 Dec 08
2
Surface graph.
What package/code could I use to create a 3-d surface graph of the predicted
values over two of the explanatory variables' coefficients?
Jim
James Bang
Department of Economics
University of Illinois
Well I AM missing the back of my head.you COULD cut me a little slack!
-Homer Simpson
2004 Aug 23
2
Reading GAL file
Greetings:
I am trying to work with spdep (everything is "brand new" downloaded this morning). OS = Windows 2000 (also up to date). The code I am using follows:
#example
gal.county=read.geoda("lnpilnd.GAL", row.names=NULL, skip=0)
summary.nb(gal.county)
Error in summary.nb(gal.county) : Not a neighbours list
#end
The gal file works just fine in GeoDa (also up to date).
2003 May 15
2
Unable to load lapack.dll when using RExcel add-in
I am having trouble using R routines from the RExcel add-in, that use lapack.dll. As an example if I start the R kernel from within Excel and execute
"x<-rbind(c(1,2),c(1,-1))
z<-solve(x)",
I get the following error:
"Error in solve.default(x): lapack routines could not be loaded.
In addition: Warning message:
unable to load shared library "C:\Program
2003 Jan 21
2
Plot using different symbols depending on value.
I am making a plot from R indicating an average, min and max value for a
number of sample types. as horizontal lines with the sample types on the
y-axis. (see http://home.newmedia.no/sickel/R.html for the plot and code) In
some cases, the min value is the detection limit, and I would like to
indicate that bu using a <, rather than the usual | I use for indicating the
value.
I am plotting each
2004 Dec 09
3
surf.ls
Hello,
I am looking into description of surf.ls(spatial)
and see under value $beta - the coefficients.
When I use polynomial of degree 2 to fit surface
I expect to get 4 coefficients:
z = a_1 x^2 + a_2 xy + a_3 y^2 + a_4
What do beta really stand for and why do I get
$beta vector of length 6?
Thakns,
Mark
2003 Jun 18
3
finding contours in a matrix
Hi,
I have matrix of sea bottom depths that I am plotting in R with the function
'image'.
I am particularly interested in the 200m depth contour (I'm using 'distance
from this feature' as a covariate in a model) and would like to extract the
data at evenly
spaced points along it. I can easily superimpose a line at 200m using the
function 'contour'. What I
want to
2001 May 23
4
Matrix manipulation
Hi,
Suppose I have a matrix with, say 12 columns.
I would like to extract out column 2 ~ 8 and 11 ~ 12 then combine them together.
I tried with success to extract out the columns by doing:
foo <- test[,2:8]
goo <- test[,11:12]
However then I am having trouble combining foo and goo.
Helps are appreciated!
Cheers,
Kevin
-----------------------------------
Ko-Kang Kevin Wang
2004 Jan 20
2
rstandard.glm() in base/R/lm.influence.R
I contacted John Fox about this first, because parts of the file are
attributed to him. He says that he didn't write rstandard.glm(), and
suggests asking r-devel.
As it stands, rstandard.glm() has summary(model)$dispersion outside the
sqrt(), while in rstandard.lm(), the sd is already sqrt()ed. This seems to
follow stdres() in VR/MASS/R/stdres.R.
Of course for the c("poisson",
2003 Sep 21
3
Z aware interpolation
Hello again,
There is any package which does Z aware (real 3D) interpolations?
It can be any method (IDW, kriging or spline) but it should take into
consideration not only x and y coordinates for interpolation, but
also z coordinate. I looked into different packages but it seems i
didn't find the right one.
The ultimate goal is to import the output into a GIS (Geographical
Information
2004 Mar 04
4
Accurate area map projections
Hi,
Could any one point me to the projection, and parameters if necessary, that
would show each country/continent with it's area accurately refelcted on the
plot? E.g. aitoff vs. albers vs. bonne vs. cylequalearea vs. guyou - they
don't all look the same to mee but some of the documentations suggests they
are equal area? Of course this isn't my field, so I am largely guessing and
am
2005 Feb 11
3
How to solve error : "cannot allocate vector of size 1208235 Kb"
Howdy R gurus !
I am newbie to R
I use R 2.0.1 in Windows XP. When I run R
I got the follwoing memory error.
My physical memory size is 3 Gb.
My R got the memory problem when it reached to
about 2 Gb.
Thanks in advance,
> library(spdep)
> sfr.lagsarlm <- lagsarlm(sfr.data$Bldgsqft ~ sfr.data$Ncounty + sfr.data$Nugb + sfr.data$Ngroup, data=sfr.data, listw=sfr.listw,
2001 Jun 02
2
inout() in splancs working properly?
I have a problem with function 'inout()' in package 'splancs' on CRAN-R
Version 1.2.3 under FreeBSD4.3-STABLE.
The following script produces and draws points and a polygon-surrounded
area. Repeating the same script many times shows, that points on the
polygon-line often, but not always, are outside of the polygon-area.
library(splancs)
# dataset with polygon (convex
2005 Jan 27
7
getting package version inside .First.lib
Greetings -
Is it possible, inside .First.lib,
to find out the version number of the package that is being loaded?
If only one version of the package has been installed,
we could scan the DESCRIPTION file, something like
.First.lib <- function(lib, pkg) {
library.dynam("spatstat", pkg, lib)
dfile <- system.file("DESCRIPTION", package="spatstat")