Displaying 3 results from an estimated 3 matches for "myraster".
Did you mean:
mymaster
2020 Oct 31
2
raster::levels() not working in packaged function.
...aster "r"
when the function is sourced from a script
source(".\R\function.r")
it works fine.
when the function is built into a package and sourced from there
library(mypackage) using the same script file to make the package
levels(r)[[1]]
the same line throws an error, as levels(myraster returns NULL
If I modify the script to include the raster namespace:
raster::levels(r)[[1]]
Then I get the error
Error: 'levels<-' is not an exported object from 'namespace:raster'
I have also tried just using levels(r) and putting raster as a depends
rather than an import in...
2020 Oct 31
0
[R-sig-Geo] raster::levels() not working in packaged function.
...pt
> > source(".\R\function.r")
> > it works fine.
> > when the function is built into a package and sourced from there
> > library(mypackage) using the same script file to make the package
> > levels(r)[[1]]
> > the same line throws an error, as levels(myraster returns NULL
> >
> > If I modify the script to include the raster namespace:
> > raster::levels(r)[[1]]
> > Then I get the error
> > Error: 'levels<-' is not an exported object from 'namespace:raster'
> >
> >
> > I have also tried...
2004 Feb 26
6
adding header info to write.table
Hello,
Could someone please tell if there is a way to append header info to the top of an exported dataframe (exported with write.table). I want to append the following, which are the defininitions for an asciigrid:
ncols 532
nrows 999
xllcorner 510465
yllcorner 4766375
cellsize 30
NODATA_value -9999
Thanks very much,
femke
[[alternative HTML version deleted]]