Parallel processing usually includes quite a lot of overhead, which is
expensive if the computation itself is quick. This is definitely an
example where the function is too simple to take advantage of
parallelization. Another thing is that your example has some errors,
which makes the effect
I don't have a solution to this problem, but as I have also struggled
with what I think is the same problem, I tried to find a small
reproducible example.
The problem seems indeed to be with the progress bar, which will clear
the console after x iterations when the progress bar is called in a
llowdimvar = TRUE, verbose = verbose) :
> Variable not found
>
>
> On Wed, Jul 27, 2016 at 1:10 AM, Jon Skoien
> <jon.sko...@jrc.ec.europa.eu <mailto:jon.sko...@jrc.ec.europa.eu>> wrote:
>
> I think you get the error because you passed the obj
ple_precip_daily.nc <http://sample_precip_daily.nc>')
> pre1
> pre1_rd = ncvar_get(pre1, 'precipitation')
> nc_close(pre1)
>
> Thanks for your help.
>
> On Tue, Jul 26, 2016 at 4:08 AM, Jon Skoien
> <jon.sko...@jrc.ec.europa.eu <mailto:jon.sko...@jrc.ec.europa.eu>&
You could try with the brick function from the raster package.
bvar = brick(netcdfName)
This uses the ncdf4 functions for opening and reading the netcdf, but
makes it easier to extract data for each day:
p1 = rasterToPoints(bvar[[1]])
and write p1 to csv.
Best,
Jon
On 7/26/2016 6:54 AM,
I have frequently noticed a strange effect when using the progress bar
in a loop, that the console will sometimes be cleared. Whatever was
printed before will then be inaccessible, which can be annoying when I
want to check the progress and possible issues in a long script. It
seems to be an
Martin,
I think the main problem is that you are trying to assign your results
to the result matrix inside the foreach loop. Parallel functions in R
are generally not good at updating parts of matrices from the different
workers in this way. Instead, using e.g. foreach, each loop of the
If df is the data.frame with values and you want nn samples, then this
is a slightly different approach:
# example data.frame:
df = data.frame(a1 = sample(1:20,50, replace = TRUE),
a2 = sample(seq(0.1,10,length.out =
30),50, replace = TRUE),
In addition to following Jim's suggestion, you should probably also use
full.names = TRUE, otherwise you will try to open a connection to files
in your current directory, not in tmpdir.
Another thing is that the unzipped files appear irregular with respect
to columns, so read.table might not
Did you attach the raster package with library(raster)? It seems the
newest version of dismo does not depend on raster, so you will not be
able to use raster-functions if you only attach dismo.
This error message typically comes when R tries to use
utils:::stack.default instead of the
Hi Frederico,
The kriging function seems to come from the kriging package (please give
also the package next time you ask a question), which I dont know. I can
therefore not tell you why it does not give you the correct result. But
R has a huge number of packages which can krige, and
As a start you might look at the spcopula package from r-forge:
install.packages(spcopula, repos = http://r-forge.r-project.org;)
Spatial copulas can also be used for interpolation in the intamap
package (on CRAN).
You are likely to get more responses to questions about spatial
modelling on
Hi,
Alternatively you could have a look at the function terrain in the
raster package, it can calculate the slope for you using different
algorithms, not sure if the one below is included though.
For typical spatial requests like this, you could also use the
mailing-list r-sig-geo.
Hi Ravi,
You would probably get more answers to this if you posted to the list
r-sig-geo. The following course was advertised a week ago and might
match your needs:
http://www.itc.nl/personal/rossiter/teach/degeostats.html
You might also find the videos from this years' GEOSTAT course in
On 13-Oct-11 20:33, Sarah Goslee wrote:
Hi,
On Thu, Oct 13, 2011 at 2:05 PM, Bailey, Danielbai...@spu.edu wrote:
Thank you Sarah. I tried your suggestion, and if I coerce it into a normal data.frame, that method works. But if you've
already made the data into a SpatialPixelsDataFrame and run
15 matches
Mail list logo