[R] replacing with NA

2012-05-16 Thread Mintewab Bezabih
Dear R users, I was wondering how I can replace the values of a vector with the values from in another vector in the same row For example, how can I replace the value of x below with NA when the value of Z in the same row is NA? x <-1:20 z<- c(11, 15, 17, 2, 18, 6, 7, NA, 12, 10,21, 25, 27,

[R] replacing with NA

2012-05-16 Thread Mintewab Bezabih
25, 27, 12, 28, 16,17, NA, 12, 10) Many thanks Mintewab Från: Mintewab Bezabih Skickat: den 15 maj 2012 15:53 Till: r-help@r-project.org Kopia: r-help@r-project.org Ämne: missing observations Dear R users, I have missing observations in my data that I rem

[R] missing observations

2012-05-15 Thread Mintewab Bezabih
Dear R users, I have missing observations in my data that I remove in my analysis. I am able to run my codes alright but I want the non missing values to be correctly identified and therefore want to tag my id vector along in my results. Since the vector of ids has no role in the analysis, I d

Re: [R] converting raster image

2012-05-11 Thread Mintewab Bezabih
Thanks Mike and Micheal for suggestions. It now worked! Many thanks Mintewab Från: Michael Sumner [mdsum...@gmail.com] Skickat: den 11 maj 2012 01:20 Till: Mintewab Bezabih Kopia: r-help@r-project.org Ämne: Re: [R] converting raster image You should

[R] converting raster image

2012-05-10 Thread Mintewab Bezabih
Dear R users, I was wondering how I can convert a raster image (that made R through interpolation) into an ascii or csv format? this is the last line of my command p <- interpolate(r, tpsfit) So p is my raster file which I want to convert into ascii or csv Many thanks Regards Mintewab

[R] interpolating climate data

2012-05-09 Thread Mintewab Bezabih
Dear R-users, I am working on interpolating the station level temperature data to farm level data. I have z vector consisting of station level temperature observations and my x and y are latitude and longitude corresponding to a farm. My understanding is I can use raster combined with tps.

[R] interpolation of climate data

2012-05-09 Thread Mintewab Bezabih
Dear R-users, I am working on interpolating the station level temperature data to farm level data. I have z vector consisting of station level temperature observations and my x and y are latitude and longitude corresponding to a farm. My understanding is I can use raster combined with tps.

Re: [R] handling missing values

2012-03-15 Thread Mintewab Bezabih
Från: R. Michael Weylandt [michael.weyla...@gmail.com] Skickat: den 15 mars 2012 19:45 Till: Mintewab Bezabih Kopia: r-help@R-project.org Ämne: Re: [R] handling missing values Try adding na.action = na.exclude to your call to gam. Michael On Thu, Mar 15, 2012 at 1:00 PM

[R] handling missing values

2012-03-15 Thread Mintewab Bezabih
Dear R users, I have problems handling missing values. THe problem is that after running my codes the result I get just skips the missing values. What I want is for the missing values to appear in my results as well. I have put a workable example below and as you could see the missing value in

Re: [R] shorter way of coding

2011-12-13 Thread Mintewab Bezabih
Thanks so much Sarah. Everything worked now! Mintewab Från: Sarah Goslee [sarah.gos...@gmail.com] Skickat: den 13 december 2011 17:36 Till: Mintewab Bezabih Kopia: r-help@r-project.org Ämne: Re: [R] shorter way of coding In exactly the same way: y.gam

Re: [R] shorter way of coding

2011-12-13 Thread Mintewab Bezabih
ata=dat) vis.gam(b) fitted(b) Many thanks once again. Mintewab Från: Sarah Goslee [sarah.gos...@gmail.com] Skickat: den 12 december 2011 17:36 Till: Mintewab Bezabih Kopia: r-help@r-project.org Ämne: Re: [R] shorter way of coding That's not a reproducible

Re: [R] shorter way of coding

2011-12-12 Thread Mintewab Bezabih
Från: Paul Hiemstra [paul.hiems...@knmi.nl] Skickat: den 12 december 2011 14:42 Till: Mintewab Bezabih Kopia: r-help@r-project.org Ämne: Re: [R] shorter way of coding On 12/12/2011 01:16 PM, Mintewab Bezabih wrote: > Dear R users, > > I am using the code below to generate a fit

Re: [R] shorter way of coding

2011-12-12 Thread Mintewab Bezabih
Från: Paul Hiemstra [paul.hiems...@knmi.nl] Skickat: den 12 december 2011 14:42 Till: Mintewab Bezabih Kopia: r-help@r-project.org Ämne: Re: [R] shorter way of coding On 12/12/2011 01:16 PM, Mintewab Bezabih wrote: > Dear R users, > > I am using the code below to generate a fit

[R] shorter way of coding

2011-12-12 Thread Mintewab Bezabih
Dear R users, I am using the code below to generate a fitted value of b. I have about 300 different values for for y (y1, y2, ...y300) which means I will have to write the code below 300 times to generate the 300 different fitted values for y. Is there a short way of doing that ? Many thanks

Re: [R] curve fitted ... how to retreive data

2011-12-09 Thread Mintewab Bezabih
THanks so much Gene, it worked mintewab Från: gley...@gmail.com [gley...@gmail.com] för Gene Leynes [gleyne...@gmail.com] Skickat: den 7 december 2011 18:43 Till: Mintewab Bezabih Kopia: r-help@r-project.org Ämne: Re: [R] curve fitted ... how to retreive

[R] curve fitted ... how to retreive data

2011-12-07 Thread Mintewab Bezabih
Dear R users, I have now managed to fit the curve using the thin plate spline as follows: library(mgcv) b <- gam(y~s(x1,x2,k=100),data =dat) vis.gam(b) What I want now is to get the fitted data for y and copy it so that I use it for further analysis. Many thanks in advance mintewab

Re: [R] problems using the thin plate spline method

2011-12-05 Thread Mintewab Bezabih
398.00 370.0 768.00 626 277.50 416.0 693.50 627 289.25 416.0 705.25 628 491.00 741.0 1232.00 629 515.00 1136.0 1651.00 Fr?n: R. Michael Weylandt [michael.weyla...@gmail.com] Skickat: den 5 december 2011 14:04 Till: Mintewab Bezabih Kopia: Jeff

Re: [R] problems using the thin plate spline method

2011-12-05 Thread Mintewab Bezabih
__ Från: R. Michael Weylandt [michael.weyla...@gmail.com] Skickat: den 5 december 2011 14:04 Till: Mintewab Bezabih Kopia: Jeff Newmiller; Sarah Goslee; r-help@r-project.org Ämne: Re: [R] problems using the thin plate spline method Your data was scrubbed by the server. Use dput() to create a p

Re: [R] problems using the thin plate spline method

2011-12-05 Thread Mintewab Bezabih
ab="x2", zlab="y", xlim=c(0,1), ylim=c(0,1), zlim=range(zf), ticktype="detailed", scale=F, main="gcv fitting") Many thanks once again. regards mintewab Från: Jeff Newmiller [jdnew...@dcn.davis.ca.us] Skickat: den 5 december 2011 12:39 Till: Mintewa

Re: [R] problems using the thin plate spline method

2011-12-05 Thread Mintewab Bezabih
ter that command. I followed the r tutorial guide to read my data and I am following the r tutorial to guide me to apply the thin plate spline method. Regards, Mintewab ____ Från: Sarah Goslee [sarah.gos...@gmail.com] Skickat: den 4 december 2011 15:21 Till:

Re: [R] problems using the thin plate spline method

2011-12-04 Thread Mintewab Bezabih
..@dcn.davis.ca.us] Skickat: den 3 december 2011 17:45 Till: Mintewab Bezabih; r-help@r-project.org Ämne: Re: [R] problems using the thin plate spline method I can tell that you are puzzled and confused. Unfortunately, I am not psychic, so I cannot tell what you did, and therefore cannot tell where y

[R] problems using the thin plate spline method

2011-12-03 Thread Mintewab Bezabih
Dear R users, I am a beginner in R trying to apply the thin plate spline method to my climate data. I used the example in R to do so, and the lines seem to run fine ( I am not getting errors) but I am not getting any output in the form of graph or anything. I got a warning message saying that