Re: [R] Steps to create spatial plots

2018-01-15 Thread Roman Luštrik
You will need to coerce your data into a "spatial" kind, as implemented in `sp` or as of late, `sf` packages. You might want to give the vignettes a whirl before you proceed. Roughly, you will have to coerce the data to Spatial* (you could go for a point, raster or grid type, I think) and also

Re: [R] DEA -- Extract the Frontier and ggplot2

2016-08-02 Thread Roman Luštrik
Hi, this is not really a ggplot2 issue, but here goes. If you look at the source code of the Benchmarking package (here ) you will notice that the function is not very explicit about what to return - so the returned thing is actually

Re: [R] export list to csv

2011-03-16 Thread Roman Luštrik
How about? sink(andrija.csv) l sink() -- View this message in context: http://r.789695.n4.nabble.com/export-list-to-csv-tp3381992p3382062.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] help: program efficiency

2010-11-26 Thread Roman Luštrik
See if this works for you. a - c(2,1,1,3,3,3,4) a.fac - as.factor(a) b - split(a, f = a.fac) system.time(lapply(X = b, FUN = function(x) { swn - seq(from = 0, to = 0 + 0.01*length(x), by = 0.01) out - x + swn return(out)

Re: [R] help: program efficiency

2010-11-26 Thread Roman Luštrik
Oops, tiny mistake. Try lapply(X = b, FUN = function(x) { swn - seq(from = 0, to = (0 + 0.01*length(x))-0.01, by = 0.01) out - x + swn return(out) }) -- View this message in context:

Re: [R] extracting objects from lists

2010-09-15 Thread Roman Luštrik
You can explore the structure of the list with str(). If you use Eclipse, a list of available options will be created for you as you type (see http://imagepaste.nullnetwork.net/viewimage.php?id=1293). Cheers, Roman -- View this message in context:

[R] my function decided to stop working, problem with scoping?

2010-08-26 Thread Roman Luštrik
Hello list. Until last week, I've been using my function without a problem. I can only imagine what has changed (no package updates), but all of a sudden, a custom function that uses raster::xyValues stopped working. For some reason, one of the values is not found, even though it's there. Here is

Re: [R] my function decided to stop working, problem with scoping?

2010-08-26 Thread Roman Luštrik
To clarify, when I run the unlist(...) in R_GlobalEnv, I create all the necessary variables (including effect.distance). -- View this message in context: http://r.789695.n4.nabble.com/my-function-decided-to-stop-working-problem-with-scoping-tp2339228p2339263.html Sent from the R help mailing

[R] pdf device (and sweave) with localized characters

2010-08-08 Thread Roman Luštrik
Dear list, I'm trying to Sweave with localized characters in graph titles and axis labels through a pdf device. I set pdf encoding through pdf.options(encoding = CP1250). When I run my script through the command line like so: R CMD Sweave report.Rnw, the localized characters turn into two dots.

Re: [R] installing and loading packages

2010-07-17 Thread Roman Luštrik
What are your user permission on the PC where you're working? -- View this message in context: http://r.789695.n4.nabble.com/installing-and-loading-packages-tp887190p2292385.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] How to say if error

2010-06-24 Thread Roman Luštrik
I'm sorry, I don't understand your problem to the detail so my suggestion may be waaay off, but how's this? You can see in vector vec - all ok values except where there's an error. n - 10 vec - rep(NA, n) for (j in 1:n) {tryCatch(ifelse(j==5, vec[j] - j, j), finally=print(oh dear))} vec

Re: [R] How to say if error

2010-06-24 Thread Roman Luštrik
Does ?tryCatch do what you want? -- View this message in context: http://r.789695.n4.nabble.com/How-to-say-if-error-tp2266619p2266749.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] cbind with vectors of different lengths?

2010-06-10 Thread Roman Luštrik
I wrote a function that cbinds vectors of different lengths. Basically, the function adds NAs to shorter vectors and cbinds in the end. I'm attaching the code for guidance. # This function takes in a list() of vectors and cbinds them into a data.frame. timerMelt - function(x, write.down = FALSE,

Re: [R] StatEt: Error R Object Browser Update java.lang.NullPointerException

2010-04-25 Thread Roman Luštrik
Have you managed to resolve this? I get the same error on Karmic Koala as well. -- View this message in context: http://r.789695.n4.nabble.com/StatEt-Error-R-Object-Browser-Update-java-lang-NullPointerException-tp1591264p2064072.html Sent from the R help mailing list archive at Nabble.com.