Tony, That is odd. ".hasSlot" is a function in the methods package (which on my system is loaded by default). Do you have an uncommon installation of R, or did you tweak it to not load the methods package? Can you send your sessionInfo() as below?
Robert > .hasSlot function (object, name) .Call("R_hasSlot", object, name, PACKAGE = "methods") <bytecode: 0x02147230> <environment: namespace:methods> > > sessionInfo() R version 2.14.1 (2011-12-22) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base On Tue, Jan 10, 2012 at 4:34 AM, tony333 <tony33...@hotmail.com> wrote: > require(raster);require(ncdf) > # Assuming that the variable name is slp > b <- brick(slp.mon.mean.nc, varname = 'slp') > # now you can plot any of the time step using: > plot(raster(b, layer = 1))# time step one > > But there might be several other ways to do what you want. > > Regards, > Lars . > ############################################################# > i use this method to plot slp.mon.mean.nc > give me error > Error in .local(x, ...) : could not find function ".hasSlot" > Error in plot(raster(b, layer = 1)) : > error in evaluating the argument 'x' in selecting a method for function > 'plot' > and i use > image.plot(raster(b,layer=1)) > the error is Error in .local(x, ...) : could not find function ".hasSlot" > thanks for help > > -- > View this message in context: > http://r-sig-geo.2731867.n2.nabble.com/problem-in-reading-NC-file-and-plot-it-tp7150538p7171863.html > Sent from the R-sig-geo mailing list archive at Nabble.com. > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo