[R] Visibility of libraries called from within functions

2016-10-13 Thread G . Maubach
Hi All, in my R programs I use different libraries to work with Excel sheets, i. e. xlsx, excel.link. When running chunks of code repeatedly and not always in the order the program should run for development purposes I ran into trouble. There were conflicts between the methods within these fun

[R] (no subject)

2016-10-13 Thread Bob O'Hara
I've just come across an odd problem with sorting in ls(): it doesn't seem to order the object names correctly. If I do the following, the order isn't what I expect: > ls(sorted=TRUE) [1] "AridData" "AridDataToBUGS""Arid.df" "Arid.hpd" "AridPrecip.sd" "Break.df" [7] "Br

Re: [R] Visibility of libraries called from within functions

2016-10-13 Thread Duncan Murdoch
On 13/10/2016 4:18 AM, g.maub...@weinwolf.de wrote: Hi All, in my R programs I use different libraries to work with Excel sheets, i. e. xlsx, excel.link. When running chunks of code repeatedly and not always in the order the program should run for development purposes I ran into trouble. There

Re: [R] (no subject)

2016-10-13 Thread PIKAL Petr
Hi Just a wild guess. Dot is ignored and the output is alphabetically sorted. You could try sort it yourself by sort(ls()) Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bob > O'Hara > Sent: Thursday, October 13, 2016 10:29 AM > To: r

Re: [R] (no subject)

2016-10-13 Thread Bob O'Hara
Yes, thanks. That seems to be it: thing <- c("M1", "M2", "M.1", "M.2") > sort(thing) [1] "M1" "M.1" "M2" "M.2" The only documentation I can find is from ?Comparison: "Collation of non-letters (spaces, punctuation signs, hyphens, fractions and so on) is even more problematic." Indeed. Bob On

[R] Antwort: Re: Visibility of libraries called from within functions

2016-10-13 Thread G . Maubach
Hi Duncan, many thanks for your reply. Your suggestion of using requireNamespace() together with explicit namespace calling using the "::" operator is what I was looking for: -- cut -- f_test <- function() { requireNamespace("openxlsx") cat("Loaded packages AFTER loading library")

Re: [R] Incremental

2016-10-13 Thread Rui Barradas
Hello, You must run the code to create x1 first, part 1), then part 2). I've tested with your data and all went well, the result is the following. > dput(dat) structure(list(y1 = c(39958L, 40058L, 40105L, 40294L, 40332L, 40471L, 40493L, 40533L, 40718L, 40771L, 40829L, 40892L, 41056L, 41110L, 411

Re: [R] Antwort: Re: Visibility of libraries called from within functions

2016-10-13 Thread Duncan Murdoch
On 13/10/2016 6:21 AM, g.maub...@weinwolf.de wrote: Hi Duncan, many thanks for your reply. Your suggestion of using requireNamespace() together with explicit namespace calling using the "::" operator is what I was looking for: -- cut -- f_test <- function() { requireNamespace("openxlsx")

Re: [R] sort()ing strings

2016-10-13 Thread Martin Maechler
> Bob O'Hara > on Thu, 13 Oct 2016 11:55:04 +0200 writes: > Yes, thanks. That seems to be it: > thing <- c("M1", "M2", "M.1", "M.2") >> sort(thing) > [1] "M1" "M.1" "M2" "M.2" which I do find strange, indeed, given your sessionInfo which contains LC_COLLATE=e

[R] Antwort: Re: Antwort: Re: Visibility of libraries called from within functions

2016-10-13 Thread G . Maubach
Von:Duncan Murdoch An: g.maub...@weinwolf.de, r-help@r-project.org, Datum: 13.10.2016 12:34 Betreff:Re: Antwort: Re: [R] Visibility of libraries called from within functions On 13/10/2016 6:21 AM, g.maub...@weinwolf.de wrote: > Hi Duncan, > > many thanks for your reply. > > Y

Re: [R] can we visualize water flows with 3d in R?

2016-10-13 Thread Thomas Adams
All, Very respectfully, there are no R packages that can do what Marna desires. His/Her data, undoubtably, comes from a 1-D hydraulic model simulation -- where output is generated at channel cross-sections -- representing the sloping water surface elevation of the centerline of flow in a stream or

Re: [R] (no subject)

2016-10-13 Thread peter dalgaard
Collating orders are a weird and wooly bunch... My hunch is that you have one of those that ignore punctuation and sorts AaBbCc, so that you are seeing Modis{d-F-F-h-P}. ?Comparison for details. -pd > On 13 Oct 2016, at 10:29 , Bob O'Hara wrote: > > I've just come across an odd problem with

Re: [R] can we visualize water flows with 3d in R?

2016-10-13 Thread Duncan Murdoch
On 13/10/2016 8:35 AM, Thomas Adams wrote: All, Very respectfully, there are no R packages that can do what Marna desires. I would guess that's not literally true, in that there are several graphics packages that are very flexible. You could well be right that there are none that are desig

Re: [R] can we visualize water flows with 3d in R?

2016-10-13 Thread Karline Soetaert
... and maybe she can find some inspiration at this website: http://www.rforscience.com/rpackages/visualisation/oceanview/ Karline -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: donderdag 13 oktober 2016 15:20 To: Thomas Adams ; David Winsemius Cc: r-he

Re: [R] sort()ing strings

2016-10-13 Thread Bob O'Hara
Thanks - strangely capabilities("ICU") is FALSE (I'm using ubuntu 16.04, and icu-devtools is installed). So I guess I'll conclude that there's something odd, but I don't want to delve into these issues (a new locale & new computer for me in a couple of months). Bob On 13 October 2016 at 13:00, Ma

[R] download multiple files in one file

2016-10-13 Thread Debasish Pai Mazumder
Hi All, I have downloaded single file from the web using following scripts gribfile<-" http://nomads.ncdc.noaa.gov/thredds/ncss/grid/modeldata/cfsv2_forecast_ts_9mon/2011/201104/20110401/2011040100/tmax.01.2011040100.daily.grb2?north=47.0126&west=-114.841&east=-112.641&south=44.8534&time_start=201

Re: [R] can we visualize water flows with 3d in R?

2016-10-13 Thread Thomas Adams
Duncan, Oh, to be sure, with a fair amount of work, you're probably correct that one could mash up something. Here are some examples: http://www.illinoisfloods.org/documents/2013_IAFSM_Conference/Conference_Presentations/5C-1_HEC-GeoRAS_Part1.pdf <--- lots of graphics http://rivergis.com/ also.

[R] ERROR : unable to start device PNG on server

2016-10-13 Thread Aanchal Sharma
Hi I realize that this question has been asked earlier also, but my problem is slightly different. I am running a rscript which runs for multiple datasets in loop and generates png for every file in the loop. When I run this only local machine (mac) it runs fine, just that that it takes very long

Re: [R] Maybe OT: Forking in R scripts?

2016-10-13 Thread Greg Snow
I don't know if the parallel approach would work or not, but a possibly simpler approach would be to use the tclTaskSchedule function from the tcltk package. You could use this to schedule your update code to run on a regular basis, then you have access to the command line between times that it ru

[R] Help reproducing this boxplot

2016-10-13 Thread Ryan Treacy
I am trying to reproduce the style of boxplot pictured in the attached image. The code below is close but I cannot get the control values the correct color. library(ggplot2) box.print <- function(C1M,C1, D2, QCDC2, QCSDT4, num){ NAME <- names(D2[num]) adjsdt4 <- C1M[,num] sdt4 <- C1[,num]

[R] Function Distributions does not exist in package stats

2016-10-13 Thread hugo
I was looking function Distribution into stats package: it does not exist! I am working with: version _ platform x86_64-pc-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status major 3 minor 3.1 year 2016

Re: [R] Function Distributions does not exist in package stats

2016-10-13 Thread Rui Barradas
Hello, 'Distribution' is not the name of a function in package stats. At an R prompt type ?Distributions. In that help page you will read "Distributions {stats} R Documentation Distributions in the stats package Description Density, cumulative distribution function, quantile function and ra

Re: [R] can we visualize water flows with 3d in R?

2016-10-13 Thread Duncan Murdoch
On 13/10/2016 11:14 AM, Thomas Adams wrote: Duncan, Oh, to be sure, with a fair amount of work, you're probably correct that one could mash up something. Here are some examples: http://www.illinoisfloods.org/documents/2013_IAFSM_Conference/Conference_Presentations/5C-1_HEC-GeoRAS_Part1.pdf <---

Re: [R] (no subject)

2016-10-13 Thread Jim Lemon
The crucial thing is probably: "... they are translated to UTF-8 before comparison." Although the first 127 characters seem to be identical to ASCII, in which punctuation marks sorted before digits or letters, the encoding to UTF-8 may make that impractical. Jim On Thu, Oct 13, 2016 at 8:55 PM

Re: [R] Function Distributions does not exist in package stats

2016-10-13 Thread Jim Lemon
Hi Hugo, If you look at the help page for "distributions", you will see that it describes a number of functions that return density functions, etc. for specific distributions. If you are looking for something that informs you which distribution might approximate an existing set of values, try the "

Re: [R] sort()ing strings

2016-10-13 Thread peter dalgaard
> On 13 Oct 2016, at 13:00 , Martin Maechler wrote: > > which I do find strange, indeed, given your sessionInfo which > contains > LC_COLLATE=en_US.UTF-8 > One of the _really_ strange things about localization is that there is no standardization. Names don't necessarily mean the same th

[R] Subclass Prediction

2016-10-13 Thread TJUN KIAT TEO
I am trying to work clustering problem where I actually know the sublcass. For example Suppose I am trying to predict cluster patients a group of people into male and female where I actually know the label male and female but I take it I don't know Suppose my clustering method produces subcl

[R] regarding predicted value from xgboost package

2016-10-13 Thread Ranjana Girish
hai everyone. i am using model building function xgboost() using code : fit <- xgboost(data =sparse_matrix , label = trainSet$OutputClass, max.depth = 4,eta = 1, nthread = 2, nround = 10, eval_metric = "merror",objective = "multi:softmax",num_class = 45) when i use the prediction function: