Displaying 20 results from an estimated 1000 matches similar to: "How to use a for loop to generate two sequences"
2006 May 12
1
[ESRI-L] outline polygons of point clumps
Sorry, I did not make my question clear. Since I have a point theme
with many points, some of them may clump together. the problems here
are:
1. how to find clumps in a point theme?
2. the convex-hull extension I found only deal with all the points in
a theme at each time? how to make each convex hull around each point
clump automatically?
Thanks.
Xiaohua
On 5/12/06, Bob Booth <bbooth
2005 Jun 21
1
How to plot circular data in the directions of 0, 0.5pi, pi and 1.5pi
Hi R users,
I use plot.circular(rad, stack=T,bins=4) and could just obtain the four
stacks in the directions of 45, 135, 225 and 315 degrees. But I want them in
0, 90, 180 and 270 degrees. Is there any parameter or any other function to
make it? Thanks for helping a R beginner.
--
Xiaohua Dai, Dr.
--------------------------------------------------------------------------------
Centre for
2006 Jun 14
1
set.seed
Hi R users,
Sorry for a simple question:
I found different people use different i in set.seed(i), are there any
rules to choose an i or one can choose as he likes?
Thanks
Xiaohua
2005 Oct 18
4
Ways to speed up R code?
Hi R-users:
Yesterday I ran a R code for 9 hours and it did not show any sign to
stop. Then I interrupted it and found it had completed 82.5%.
This morning I decided to wait for another 11 hours to see what will
happen. Wait a minute, I heard that transforming data.frame to matrix
will make R code faster. Then I made the modification in my R code.
Oooh, the new code finished within 30 minutes!!
2006 Feb 15
1
Multiple comparison for circular data
Hi All,
Does anyone know how to compare the means of several circular-data
samplings? Any related websites, references and softwares?
Thanks
Xiaohua
--
Xiaohua Dai, Dr.
[[alternative HTML version deleted]]
2005 Jun 30
3
[OT] gmail filter for R-help and R-devel lists
This is slightly off-topic but I would be interested in whether anyone
has succeeded in creating a filter expression for Google's gmail
system that will select messages sent through the R-help and R-devel
lists. It seems as if it should be easy to select on '[R]' or '[Rd]'
in the subject line but I haven't been able to work out the exact
syntax that would do this and not
2006 May 11
1
package update problem
Hi all,
>From late April, everytime when I update my packages, the package
"gap" is always on the list of "packages to be updated". I try to
download and install the gap zip file from CRAN. However, the same
problem still remains. No such problem for other packages.
> Sys.info()
sysname release
2005 Jul 13
5
maps drawing
Hello,
is there a package in R that would allow map drawing:
coastlines, country/state boundaries, maybe
topography,
rivers etc?
Thanks for any guidance,
Mark
2005 Sep 12
1
help for linear-circular correlation
Hi R-profs,
Maybe my question is a little off topic. Could any one tell me how to
calculate a linear-circular correlation coefficient and its p-values?
I had a quick look at circular and CircStats packages and did not find
the related function.
Thanks for any kindly help.
Xiaohua
--
Xiaohua Dai, Dr.
Centre for Systems Research, Durban Institute of Technology
P.O.Box 953, Durban 4000, South
2005 Jul 06
2
How to sample x-y coordinates from GIS files
Hi Gurus!
I have a job that is to get randomly samples from point-based GIS data (sp
called shape GIS files) under the total sum resctricted.
For example, I would like to take random smaples under the 1000 persons in
each city.
The randomly sampled persons should not be over 1000 any case.
Thank you in advance,
--
Kum-Hoe Hwang, Ph.D.
Phone : 82-31-250-3283
Email : phdhwang@gmail.com
2005 Aug 03
1
help for cell2nb and queencell in spdep package
Dear Dr. Bivand and R-users,
I have a 5 by 5 grid, say, location[1:5,1:5], and I want to know the
indices of 8 neighbours of each cell. For example, for location[2,2], its
neighbour coordinates are [1,1:3], [2,1], [2,3] and [3,1:3]. Sometimes I
also need to remove edge effects (torus = TRUE).
I have tried "cell2nb" function in your spdep package. Here's my example:
> neigh
2006 May 27
1
Trouble passing list or non-list to function using ...
Hello,
Simply put, I'm trying to call a function "testme" with value "age=NA". I wish to use "dotlist<-list(...)" inside the function and have dotlist become:
$age
[1] NA
I'm modifying existing code and need to minimize changing that code so it's easiest to conform
how I call the existing function.
My sample code fragment, results, and R.version
2005 Oct 13
3
How to generate for one vector matrix
Is there any routine to generate for one vector matrix.
If I have X I want to generate start from zero to maximum value each vector.
For example, I have a vector x = (4,2,3,1,4)
I want to generate n=6 times, for 4, start 0 to 4, then 2 start 0 to 2, ect.
The result something like this:
generate(x,n=6)
1,1,2,1,4
1,2,3,0,3
4,0,1,1,1
3,1,0,1,4
0,0,3,0,0
4,1,3,0,4
Could anyone help me. Thanks.
2012 May 03
1
deparse(substitute(x)) on an object with S3 class
Dear list,
can someone explain to me why deparse(substitute(x)) does not seem to work
when x is of a user-defined S3 class?
In my actual problem, my print method is part of a package, and the method
is registered in the NAMESPACE, if that should make a difference.
> print.testclass <- function(x,...){
xname <- deparse(substitute(x))
cat("Your object name
2011 Oct 22
3
Wine 1.3.31 fails to compile in git
I tested also with a clean git source. Something wrong with ole32.
Code:
-fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wstrict-prototypes -Wtype-limits -Wwrite-strings -fno-omit-frame-pointer -Wpointer-arith -Wlogical-op -I/usr/include/freetype2 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -o tmarshal_i.o tmarshal_i.c
2011 Nov 10
2
Removing numbers from a list
I am using gsub to remove numbers for each element of a list. Code is given
below.
testList <- list("this contains a number 1000","this does not contain")
removeNumbers <- function(X)
{
gsub("\\d","",X)
}
outputList <- lapply(testList,removeNumbers)
However, when I try to find the number of words in outputList as follows
2010 Jan 15
4
transposing a list of vectors
I have a list of vectors, all forced to be the same length:
testlist <- list(
shape=c(0, 0, 2),
cell.fill=c("red","blue","green"),
back.fill=rep("white",3),
scale.max=rep(100,3)
)
> str(testlist)
List of 4
$ shape : num [1:3] 0 0 2
$ cell.fill: chr [1:3] "red" "blue" "green"
$ back.fill: chr [1:3]
2005 Oct 17
2
how to find indices of particular array elements
Dear R helpers,
I have a largish matrix (1300 x 1300) and I wish to find the row and column
numbers that identify particular elements whose values I know in advance
(for example, the row and column numbers for the maximum value of the
matrix).
I have looked in the help manual and found the functions 'row' and 'col' for
finding the indices of a matrix. But, I can't figure out
2006 Apr 26
3
copying previously installed libraries to R 2.3.0
hi all,
is there a new mechanism in R 2.3.0 for copying libraries from, say, R 2.2.1 to R 2.3.0? i ask because gabor grothendieck comments in his copydir.bat (from gabor's batchfiles at: http://cran.r-project.org/contrib/extra/batchfiles/batchfiles_0.2-5.zip ):
``:: I personally upgraded my 2.1.0 to 2.2.0 this way so it seems ok until
:: R replaces this with something better which is
2005 Dec 23
2
for loop error
I have the following code and I am not sure what's wrong or how to make it
work.
B <- matrix(1,nrow=50,ncol=2)
for (i in 1:length(size.out)){ # length(size.out=2) these
are the two variables
X <- var.range[i,1] # min
Y <- var.range[i,1] # min
ratio <- size.out[,i]
for (j in 1:groups)