Displaying 20 results from an estimated 5000 matches similar to: "build a SpatialLines object from a list"
2017 Sep 25
0
build a SpatialLines object from a list
Hi Ashraf,
It is not obvious to me what your structures are but one problem in your
function is the assignment tt1 <- SpatialLines(list(tt[[i]])).
This will set tt1 to just have one item.
Consider the following
test.func <- function(x) {
tt1 <- list()
for ( i in ... ) {
...
tt1[[i]] <- SpatialLines(tt[[i]])
}
return(tt1)
}
HTH,
Eric
On Mon, Sep 25,
2017 Sep 26
2
build a SpatialLines object from a list
Hi Eric,
Thanks for the help.But this will not solve the problem as it will generate a list and what I need is an object of class sp using SpatialLine function from sp package.So, I need to convert each matrix to coordinates and then to a line and then to a spatial line as figured in the code.
My data structure is a list of 141 matrices.Each matrix represents coordinates of the river lines
2017 Sep 26
0
build a SpatialLines object from a list
Hi Ashraf,
In that case I think you may need to structure the code to first build the
list and only at the end supply that to the SpatialLines function,
something like
test.func <- function(x) {
tt <- list()
for ( i in ... ) {
...
tt[[i]] <- (whatever)
}
return(SpatialLines(tt))
}
Eric
On Tue, Sep 26, 2017 at 12:36 PM, Ashraf Afana <asafaneh at
2011 Oct 26
2
SpatialLines
I'm hoping to use R for spatial analysis. In working through examples in Chapt. 4 of Applied Spatial Data Analysis with R I've come across the following error in trying to plot lines with the meuse data set. The text is verbatim from the book.
> m.sl <- SpatialLines(list(Lines(list(Line(cc)))))
Error in Lines(list(Line(cc))) : Single ID required
What does "Single ID
2008 Dec 05
2
xtable html links
Hi,
I was trying to get hyperlinks using xtable, but couldn't get the hyperlinks to function properly. For example, if I use
## Try to link NY times website to every figure in column 4
mat <- matrix(1:43,6,5)
mat[,5] <- "http://nytimes.com"
for(i in 1:nrow(mat)){
strr <- paste('<a href="', mat[i,5],'">', mat[i,4], '</a>',
2017 Oct 11
1
Iterate in a Spatial Polygon Dataframe in R?
Hi all,
?I'm trying to iterate in a SpatialPolygonDataFrame thatcontains 110 features. I tried to use the following code?
iterate.spdf =function(x){ for (i in 1:nrow(x)){ p = x[i, ]} return(p)}
but with no success as it returns with aSpatialPolygonDataFrame that contains onlyone feature. The code seems to overwrite the polygons to end up with only onefeature.
?Any suggestions?Ashraf, cheers
2002 Apr 02
1
cbind.ts bug?
The following creates a time series tt1 whose values rise from 1
to 20 and another time series tt2 each of whose values are 10 larger
than the corresponding value in tt1. When we attempt to bind them
together as columns, the entry after Dec 1960 is erroneously listed
as NA 1960 instead of Jan 1961. If n is changed to either 19 or is
changed to 21 in the example below, the example suddenly
2013 Apr 26
1
[newbie] how to find and combine geographic maps with particular features?
SUMMARY:
Specific problem: I'm regridding biomass-burning emissions from a
global/unprojected inventory to a regional projection (LCC over North
America). I need to have boundaries for Canada, Mexico, and US
(including US states), but also Caribbean and Atlantic nations
(notably the Bahamas). I would also like to add Canadian provinces and
Mexican states. How to put these together?
General
2012 May 03
6
Cannot read or write to file in Linux Ubuntu
I am the proud owner of a new laptop since my old one died the other day.
Currently I have a dual-boot Windows 7 Home and Ubuntu 12.04 . I'll leave the Windows problems for another post.
I know practically nothing about Linux so I am probably doing something stupid but ... at the moment I cannot seem read or write files in Ubuntu. I am not having any problem saving other documents to the
2009 Jul 14
1
Error when sampling from SpatialLines
Dear forum,
I am working in R 2.9.1 and I am trying to sample locations from a network file. Reading in nor plotting is a problem, however when I am trying to sample from the file I get the following message:
nwlim<-readShapeLines("C:/Limburg_nwshape", proj4string=CRS("+init=epsg:31300"))
plot(nwlim)
randacc<-spsample(nwlim,n=1000,"random")
2017 Nov 15
1
Rasterize function with maximum in R
Hi all,
I have some concerns regarding the rasterize option in R and I would like to know if the fun=max in rasterize in R provides similar results to the one achieved by using "Polygon to Raster using maximum-combined-area" in ArcGIS?
I'm trying to rasterize a habitat layer to a raster of 10m spatial resolution using the function 'max' (e.g. r <- rasterize(ht, r,
2004 Nov 21
3
Help with ooplot(gplots) and error bars
Dear All
I am trying to graph a proportion and CI95% by a factor with ooplot (any
other better solution ?)
It works well until I try to add the confidence interval.
this is the error message and and a description of the data:
> dat1
PointEst
TT1 1 3.6
TT2 2 5.0
TT3 3 5.8
TT4 4 11.5
TT5 5 7.5
TT5 6 8.7
TT7 7 17.4
> dat2
2012 Jun 08
3
Resolution issue with exporting plots from R and write tables in Latex code for producing pdf document
Dear R users
I am trying to exporting plots from R to an external folder, or to the
working directory, but the resolution of plots (pdf file) largely reduced.
Any way I can get same quality as my original plots?? e.g. I tested the
plotting part using one example and obtained pretty good (/readable)
quality for each plot in the (4*4) multiple graph. But when I did the loop
and tried to export
2004 Nov 24
1
reshaping of data for barplot2
Dear All,
I have the following data coming out from
s <- with(final,
summarize(norm, llist(gtt,fdiab),
function(norm) {
n <- sum(!is.na(norm))
s <- sum(norm, na.rm=T)
binconf(s, n)
}, type='matrix')
)
ie
gtt fdiab norm.norm norm.norm2 norm.norm3
18
2011 Mar 24
2
Problem with pam-auth and winbind
Hi
I try to use windbind rule to authenticate users in dovecot login procedure.
/etc/nsswitch.conf file:
passwd: files winbind
shadow: files winbind
group: files winbind
when I try logon from my console to dovecot (pop3 server):
# telnet komp14 110
Trying 10.10.10.38...
Connected to komp.xxx.xxx (10.10.10.38).
Escape character is '^]'.
+OK Dovecot ready.
user tt1
+OK
pass xxxxxxxxx
-ERR
2012 Apr 14
2
Calculate t.test for a matrix
Hello everyone,
I have a data frame (tt), see below (I only show 2 genes, actually I have a
lot):
group gene1 gene2 Control 28.9776 9.9355
Control 28.9499 10.0997 Control 29.5468 14.2995 Control 29.5246 13.9561
Test1 29.1864 9.7718 Test1 29.2048 10.0388 Test1 34.9563 11.9509 Test1
34.9464 11.8909 Test2 36.9566 14.5316 Test2 37.1309 14.5188 Test2 36.1017
2011 Mar 18
1
Problem with pam-auth and winbind
Hi
I try to use windbind rule to authenticate users in dovecot login procedure.
/etc/nsswitch.conf file:
passwd: files winbind
shadow: files winbind
group: files winbind
Configuration of the dovecot is follows:
log_path: /var/log/dovecot/error.log
info_log_path: /var/log/dovecot/info.log
protocols: imap imaps pop3 pop3s
ssl_cert_file: /etc/pki/tls/certs/dovecot.pem
ssl_key_file:
2004 Dec 09
2
"sequence of factor settings"?
Hi,
exist in any package a function which "work with sequences".
Easy example 10 factors with 2 levels, are if i'm
correct theoretical 2^10 "sequences" possible.
But i have more than 2 levels and perhaps more than 10 factors and
interested for the top10 "sequence's"
with higehest freqs and wish to know which type of sequence it is.
Many thanks for a
2013 Feb 16
1
[LLVMdev] A weird problem when try to output operand of instruction involving function pointer in a struct
Hi all,
I just start to learn llvm. I am trying to get the operand's name of some
instruction that invokes a function field of a struct. While, I found in
the result that there is a sequence number attached to the function field
name. Below is an example:
/******source code t2.c*******/
#include <stdio.h>
void F(){printf("F\n");}
void E(){printf("E\n");}
void
2011 Jan 30
4
Extract time only from POSIXlt object
How can I extract only the time component from an POSIXlt object?
For example if I try the following it still returns both the date and
time...
>as.POSIXlt(tr.date[1])
[1] "2010-10-18 21:46:53"
>as.POSIXlt(tr.date[1],"%H:%M:%S")
[1] "2010-10-18 21:46:53"
round and trunc don't help... is there an "as.Time" equivalent to as.Date
?
Thanks,