[R] merging unbalanced rows

2012-05-21 Thread Belay Gebregiorgis
Hi Everyone, I am merging two data frames that have different number of rows. But I end up having rows a lot more than both rows combined. I tried the following but the duplicate bit does not change anything. Can anyone suggest to me how I can handle this? Regards, Belay x <-c(1, 2, 3, 4,5, NA

Re: [R] converting csv to image file

2012-05-20 Thread Belay Gebregiorgis
o directions then you > would 'cw.x' and 'cw.y'... if you know what I mean). > > Cheers, > Simon > > > On Sat, May 19, 2012 at 9:42 PM, Belay Gebregiorgis > wrote: > > Thanks Simon. I have other vectors in the CSV file so after naming my > > l

Re: [R] converting csv to image file

2012-05-19 Thread Belay Gebregiorgis
t file contains only the image data, you should > be able to say: > > r <- raster(as.matrix(read.csv("file.csv"))) > extent(r) <- extent(xmin, xmax, ymin, ymax) > > and not worry about the projection (if it is plain old decimal degrees) > > Regards, > Simon &g

[R] converting csv to image file

2012-05-19 Thread Belay Gebregiorgis
Hello everyone, I want to get a 1km by lkm grid raster image using my csv data. If I call latitude=a, longitude=b and preciptation=c. a<-(1,2,3,4,5) b<-(6,7,8,9,10) c<-(10,20, 30,40, 50) Then I found an example in r help which goes like pts = read.table("file.csv",..) library(sp) library(rg