Hi,

Thanks for your response. I have used traceback() and found out that the
bug is in the mask_10m.asc.

The following is the message:

12: stop("missing values in object")
11: na.fail.default(list(annaul_2001 = c(945.134, 648.716, 559.562,
    655.574, 771.144, 805.434, 1276.604, 519.938, 1036.574, 763.016,
    757.428, 1062.482, 851.662, 720.852, 672.084, 855.218, 599.948,
    745.744, 685.292, 699.77, 775.97, 752.602, 573.786, 755.65, 628.904,
    849.63, 741.426, 676.402, 909.066, 695.452, 577.85, 707.644,
    762, 824.738, 919.48, 653.034, 781.304, 886.968, 828.802, 842.518,
    459.994, 624.84), mask_10m.asc = c(88.5786418914795, 45.8059759140015,
    15.0768859386444, 12.3127512931824, 71.3703689575195, 152.519027709961,
    1005.87916564941, 11.7274975776672, NA, 228.937419891357,
181.906177520752,
    318.3203125, 502.518295288086, NA, 42.9922714233398, NA, NA,
    104.217571258545, 177.359172821045, 232.616687774658, 457.08145904541,
    398.026458740234, NA, 232.151866912842, 64.8636112213135,
320.606918334961,
    154.726047515869, 240.452461242676, NA, 293.9072265625, NA,
181.774570465088,
    222.223022460938, 192.939517974854, 583.289840698242, 782.529495239258,
    497.32640838623, 1249.03039550781, 347.13688659668, NA, NA, NA
    )))

I have tried to use na.omit to remove the NAs from mask_10m.asc, but it
seems not work in this case.

Do you have any idea about how to get rid of NAs from ascii data? I have
attache the ascii file and precipitation file I used.

Many thanks in advance.

Best,

Helen​
 mask_10m.asc
<https://docs.google.com/file/d/0BxOsJNA0fHDrZjBSZURXNTBNWWM/edit?usp=drive_web>
​

2014-09-25 2:04 GMT-07:00 Edzer Pebesma <[email protected]>:

> We can only speculate, but mask_10m.asc may contain missing values, and
> not refer to rainfall (directly).
>
> On 09/25/2014 09:57 AM, Tomislav Hengl wrote:
> >
> > Helen,
> >
> > Most likely you need to subset the missing values by using e.g.
> > "precip[!is.na(precip$annaul_2001),]", but it is difficult to see if you
> > maybe have a typo with variable names.
> >
> > Try using "traceback()" and check the amount of missing values by using
> > e.g. "summary(is.na(precip$annaul_2001))" and/or
> > "summary(complete.cases(precip))".
> >
> > HTH,
> >
> > T. (Tom) Hengl
> > Researcher @ ISRIC - World Soil Information
> > Url: http://www.wageningenur.nl/en/Persons/dr.-T-Tom-Hengl.htm
> > Network: http://profiles.google.com/tom.hengl
> > Publications: http://scholar.google.com/citations?user=2oYU7S8AAAAJ
> >
> >
> > On 25-9-2014 7:57, Helen Chen wrote:
> >> Hi,
> >>
> >> I am following the code provide from this link:
> >>
> http://spatial-analyst.net/wiki/index.php?title=Regression-kriging_guide)
> >> with my own data.
> >>
> >> but I got stuck in fitting variogram, the error message is as follow:
> >>
> >>> vgm_precip_r <- fit.variogram(variogram(annaul_2001~mask_10m.asc,
> >> precip), model=null.vgm)
> >> Error in na.fail.default(list(annaul_2001 = c(945.134, 648.716,
> >> 559.562,  :
> >>    missing values in object
> >>
> >> But I have checked that there is no missing value in my rainfall data.
> >> Any
> >> help would be very much appreciated.
> >>
> >> Helen
> >>
> >>     [[alternative HTML version deleted]]
> >>
> >> _______________________________________________
> >> R-sig-Geo mailing list
> >> [email protected]
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > [email protected]
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
> --
> Edzer Pebesma
> Institute for Geoinformatics (ifgi), University of Münster
> Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
> 83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795
>
>
> _______________________________________________
> R-sig-Geo mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
Lon,Lat,annaul_2001
-120.1291667,34.48333333,945.134
-119.9516667,34.44666667,648.716
-119.8461111,34.415,559.562
-119.7,34.4166666,655.574
-119.7666667,34.45,771.144
-119.7302778,34.45416667,805.434
-119.6958333,34.49166667,1276.604
-119.5166667,34.4,519.938
-120.1777778,34.53388889,1036.574
-119.6166667,34.45,763.016
-119.6833333,34.45,757.428
-119.8,34.48972222,1062.482
-119.5638889,34.45694444,851.662
-120.1966666,34.613333,720.852
-119.640555,34.429444,672.084
-120.337777,34.53166666,855.218
-120.405,34.583333,599.948
-119.33105,34.367972,745.744
-119.29638,34.429305,685.292
-119.231305,34.44805,699.77
-119.180361,34.466638,775.97
-119.1899444,34.437222,752.602
-119.2926944,34.2825277,573.786
-119.229861,34.380388,755.65
-119.295,34.343333,628.904
-119.3057222,34.483805,849.63
-119.30111,34.3951388,741.426
-119.2219444,34.4413888,676.402
-119.174888,34.409222,909.066
-119.2486389,34.46052777,695.452
-119.2595278,34.28047222,577.85
-119.336666,34.4152777,707.644
-119.2852222,34.4446111,762
-119.3710833,34.40797222,824.738
-119.269944,34.51541666,919.48
-119.20875,34.48191666,653.034
-119.2141666,34.3541666,781.304
-119.230777,34.509888,886.968
-119.3065,34.49275,828.802
-119.1850833,34.54341666,842.518
-119.3022777,34.5716666,459.994
-119.3362777,34.60819444,624.84
_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to