Re: [R] Help reinstalling rgdal (Ubuntu 16.04)

2018-08-09 Thread Jeff Newmiller
Or ask on R-sig-debian... On August 9, 2018 3:13:38 PM PDT, "MacQueen, Don via R-help" wrote: >There are quite a few messages on R-sig-geo about installing rgdal on >Ubuntu. Maybe one of them contains your solution? >(I use Mac, so can't help directly) > >-Don > >-- >Don MacQueen >Lawrence

Re: [R] Trying to Generalize a Function in R

2018-08-09 Thread Joshua Ulrich
Peter was on the right track. getSymbols() allows you to specify that you want the value returned as an object instead of load()ed by setting auto.assign = FALSE. I've also made other changes to your function: - Use requireNamespace() so you don't alter the search() path - Use TTR::ROC() to

Re: [R] Trying to Generalize a Function in R

2018-08-09 Thread Bert Gunter
" I am thinking that there should be an R command to tell me about the structure of series" ?str ## perhaps also/instead ?summary Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in

Re: [R] Trying to Generalize a Function in R

2018-08-09 Thread rsherry8
Peter, Here is the R command and its output that you requested: > class(AVB) [1] "xts" "zoo" Bob On 8/9/2018 5:29 PM, Peter Langfelder wrote: Well, your function uses AVB$AVB.Close, so I assumed AVB is a list (a data frame can be thought of as a special list). What do you get when you type

Re: [R] Help reinstalling rgdal (Ubuntu 16.04)

2018-08-09 Thread MacQueen, Don via R-help
There are quite a few messages on R-sig-geo about installing rgdal on Ubuntu. Maybe one of them contains your solution? (I use Mac, so can't help directly) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 Lab cell 925-724-7509

Re: [R] Help reinstalling rgdal (Ubuntu 16.04)

2018-08-09 Thread Jim Lemon
Hi Alex, I don't use Ubuntu, but if I saw that error message I would upgrade my C++ compiler and try again. With luck, this is what caused the cascade of errors beneath it. Jim On Fri, Aug 10, 2018 at 1:36 AM, Alexandra Thorn wrote: > Hi all, > > Following some updates to R that I received via

Re: [R] Trying to Generalize a Function in R

2018-08-09 Thread rsherry8
Duncan, Thanks for the response. I tired the following: > series <- getSymbols("AVB", src = "yahoo", from = start, to = end) > series[0] character(0) > nrow( series ) NULL nrow( series ) returned NULL. I do not understand why. I am thinking that there should be an R

Re: [R] Trying to Generalize a Function in R

2018-08-09 Thread Peter Langfelder
Well, your function uses AVB$AVB.Close, so I assumed AVB is a list (a data frame can be thought of as a special list). What do you get when you type class(AVB)? Peter On Thu, Aug 9, 2018 at 2:24 PM rsherry8 wrote: > > Peter, > > Thanks for the response. I tired the following command: >

Re: [R] Trying to Generalize a Function in R

2018-08-09 Thread rsherry8
Peter, Thanks for the response. I tired the following command: AVB[["AVB.Close"]] and I got: Error in AVB[["AVB.Close"]] : subscript out of bounds Are you assuming that AVB is a data frame? I do not think AVB is a data frame. Is there a way for me to check? Thanks, Bob On 8/9/2018

[R] Help reinstalling rgdal (Ubuntu 16.04)

2018-08-09 Thread Alexandra Thorn
Hi all, Following some updates to R that I received via Synaptic Package Manager on Ubuntu 16.04 (looks like I now have R 3.4.4-1xenial0), I have been unable to reinstall rgdal, and I need help. Initially I was getting error messages about dependencies on GDAL 1.11.4, but after following

Re: [R] Trying to Generalize a Function in R

2018-08-09 Thread Peter Langfelder
If I understand it correctly, the function getSymbols creates a variable with the name being the stock symbol. Then use the function get(symbol) to retrieve the value of the variable whose name is contained in the character string `symbol'. Assign that to a variable (e.g. AVB). You may also have

[R] Trying to Generalize a Function in R

2018-08-09 Thread rsherry8
I wrote the following function: # This method gets historical stock data for the stock Avalon Bay whose symbol is AVB. getReturns <- function(norm = FALSE) { library(quantmod) getSymbols("AVB", src = "yahoo", from = start, to = end) length = length( AVB$AVB.Close ) close =

[R] Assistance needed to run bootstrapping using benchmarking package

2018-08-09 Thread Ekow Asmah
Hello everyone. I am trying to run bootstrapping with DEA's directional distance function using benchmarking Package. i have tried all i could but without success. the actual problem is with the following commands: 1. dhat <- dea.direct(...) 2. Bm[i,] <- dea.direct (.) The details of the

Re: [R] Plot function: hourly data and x-axis

2018-08-09 Thread Jeff Newmiller
Pre-process your data into per-day or per-month records, then plot it. There are many ways to do this... for example, base R has the aggregate function, and the dplyr package has the group_by/summarise functions, and the data.table package can do this as well (read the vignettes). All of these

Re: [R] Warnings using SuperLearner?

2018-08-09 Thread Bert Gunter
A guess: It sounds like you are overspecifying models leading to numerical issues during the various optimizations being performed. Try simplifying your model (reducing the number of predictors). Without more details on your data and model, it may be difficult to diagnose beyond such a guess,

Re: [R] error with the expand.grid command

2018-08-09 Thread MacQueen, Don via R-help
In my experience, error messages that reference a closure usually mean that you have supplied a function where you aren't supposed to. In this case, I'd look and see if lon, lat, or time is a function (by accident, of course). More specifically, right now in one of my R sessions, I get: >

Re: [R] Plot function: hourly data and x-axis

2018-08-09 Thread MacQueen, Don via R-help
Normally, one turns off the x-axis tick marks and labels by supplying xaxt='n' in the plot() call, and then adds a customized x-axis using the axis() function. But without more information, little help can be provided (a vague question receives a vague answer). I'd suggest reviewing the

[R] Warnings using SuperLearner?

2018-08-09 Thread Kan Z. Gianattasio
Hello, I'm using the CV.SuperLearner to model a binary outcome using a set of predictors, specifying family=binomial(), method = "method.AUC", and SL.library = c("SL.glmnet", "SL.glm", "SL.randomForest", "SL.gam", "SL.polymars", "SL.mean"). I'm getting a number of warning messages (copied

[R] Plot function: hourly data and x-axis

2018-08-09 Thread Edoardo Silvestri
Hi all, I have a little problem with plot function.. I have an hourly dataset and I would like plot a variable with x-axis based on daily or monthly frequency, just to have a better visualization and avoid on x-axis all hours of the dataset. Do you know what is the solution? Thanks Edo

Re: [R] security using R at work

2018-08-09 Thread Bjørn-Helge Mevik
The section I'm working in runs a facility for sensitive research data (https://www.uio.no/english/services/it/research/sensitive-data/). Our users use R (along with other analysis software). We don't consider R safe or unsafe, but have designed the services so that it should not be possible (or

Re: [R] error with the expand.grid command

2018-08-09 Thread Ben Tupper
Hello, You will have much better success if you subscribe and post to the R-sig-geo mailing list rather than the R-help mailing list. You can subscribe to that list here... https://www.r-project.org/mail.html If you are open to other suggestions, here

Re: [R] exponential day

2018-08-09 Thread S Ellison
> Please, how can I determine parameters from exponential equation Example > one: y = a*exp(-b*x); how do I determine a and b , as well as R-square > from data sets. And also fitting y = a*exp(-b*x) into the data sets Assuming > data sets A = (0,2,4,6,8,10) B = (1,0.8,0.6,0.4,0.2,0.1) For

Re: [R] security using R at work

2018-08-09 Thread S Ellison
> If I install R on my work network computer, will the data ever leave our > network? As far as I know, if you run R locally (and not, say, on an amazon EC2 instance) your data - indeed anything about you or your machine - will only leave your desktop if you download and run an R package that

Re: [R] sub/grep question: extract year

2018-08-09 Thread Enrico Schumann
Quoting Marc Girondot via R-help : Hi everybody, I have some questions about the way that sub is working. I hope that someone has the answer: 1/ Why the second example does not return an empty string ? There is no match. subtext <- "-1980-" sub(".*(1980).*", "\\1", subtext) # return

Re: [R] security using R at work

2018-08-09 Thread john matthew via R-help
Hi Katherina. Good point you make. What makes your IT department happy with the use of R studio server? What are the safe packages? Can I trust your answer? :) John. On 9 Aug 2018 10:38, "Fritsch, Katharina (NNL) via R-help" < r-help@r-project.org> wrote: > Hiya, > I work in a very security

Re: [R] F-test where the coefficients in the H_0 is nonzero

2018-08-09 Thread peter dalgaard
The null hypothesis is different (and the different numerator Df is the givaway). > lm0 <- lm(y~-1, df1) > anova(lm0,lm1) Analysis of Variance Table Model 1: y ~ -1 Model 2: y ~ x Res.Df RSS Df Sum of Sq F Pr(>F) 1 3 149.0 2 1 1.5 2 147.5

Re: [R] sub/grep question: extract year

2018-08-09 Thread Marc Girondot
I answer myself to the third point: This pattern is better : pattern.year <- ".*\\b(18|19|20)([0-9][0-9])\\b.*" subtext <- "bla 1880 bla" sub(pattern.year, "\\1\\2", subtext) # return 1880 subtext <- "bla 1980 bla" sub(pattern.year, "\\1\\2", subtext) # return 1980 subtext <- "bla 2010 bla"

Re: [R] sub/grep question: extract year

2018-08-09 Thread john matthew via R-help
So there is probably a command that resets the capture variables as I call them. No doubt someone will write what it is. On 9 Aug 2018 10:36, "john matthew" wrote: > Hi Marc. > For question 1. > I know in Perl that regular expressions when captured can be saved if not > overwritten. \\1 is the

[R] error with the expand.grid command

2018-08-09 Thread Mayur Tade
hello sir... i am trying to extract the chlorophyll data of particular lat and lon from the world chlorophyll data from the netcdf file in R. as i am new to R i am facing the problem related to it when i am trying expand.grid command it is showing me this message.message is followed.its

Re: [R] sub/grep question: extract year

2018-08-09 Thread john matthew via R-help
Hi Marc. For question 1. I know in Perl that regular expressions when captured can be saved if not overwritten. \\1 is the capture variable in your R examples. So the 2nd regular expression does not match but \\1 still has 1980 captured from the previous expression, hence the result. Maybe if

Re: [R] security using R at work

2018-08-09 Thread Fritsch, Katharina (NNL) via R-help
Hiya, I work in a very security conscious organisation and we happily use R. The average user can only use R via RStudio Server, with a limited number of packages available, so that adds an additional level of control. That said, are you sure that the sentence 'a few people on a mailing list

Re: [R] F-test where the coefficients in the H_0 is nonzero

2018-08-09 Thread Achim Zeileis
On Thu, 9 Aug 2018, John wrote: Hi, I try to run the same f-test by lm (with summary) and the function "linearHypothesis" in car package. Why are the results (p-values for the f-test) different? The standard F test in the summary output tests the hypothesis that all coefficients _except

Re: [R] sub/grep question: extract year

2018-08-09 Thread Marc Girondot via R-help
I answer myself to the third point: This pattern is better to get a year: pattern.year <- ".*\\b(18|19|20)([0-9][0-9])\\b.*" subtext <- "bla 1880 bla" sub(pattern.year, "\\1\\2", subtext) # return 1880 subtext <- "bla 1980 bla" sub(pattern.year, "\\1\\2", subtext) # return 1980 subtext <- "bla

Re: [R] F-test where the coefficients in the H_0 is nonzero

2018-08-09 Thread Mark Leeds
Hi: the F-test is a joint hypothesis ( I never used that function from the car package but it sounds like it is ) and the t-statistics that come out of a regression are "conditional" in the sense that they test the significance of one coefficient given the other so you wouldn't expect the two

Re: [R] F-test where the coefficients in the H_0 is nonzero

2018-08-09 Thread John
Hi, I try to run the same f-test by lm (with summary) and the function "linearHypothesis" in car package. Why are the results (p-values for the f-test) different? > df1<-data.frame(x=c(2,3,4), y=c(7,6,8)) > lm1<-lm(y~x, df1) > lm1 Call: lm(formula = y ~ x, data = df1) Coefficients:

Re: [R] security using R at work

2018-08-09 Thread john matthew via R-help
Hello Laurence. Taking a pragmatic approach. If the data is so valuable and secret but also needs some analysis in R, here is suggested steps to minimise security risks. 1. Plan the analysis up front, what exactly what you want and the outcomes. 2. Take a laptop with Internet, install R and all

Re: [R] security using R at work

2018-08-09 Thread Barry Rowlingson
On Thu, Aug 9, 2018 at 9:14 AM, Jan van der Laan wrote: > You can also inadvertently transmit data to the internet using a package > without being obviously 'stupid', e.g. by using a package that uses an > external service for data processing. For example, some javascript > visualisation libs can

Re: [R] security using R at work

2018-08-09 Thread Jan van der Laan
You can also inadvertently transmit data to the internet using a package without being obviously 'stupid', e.g. by using a package that uses an external service for data processing. For example, some javascript visualisation libs can do that (not sure if those wrapped in R-packages do), or,

[R] sub/grep question: extract year

2018-08-09 Thread Marc Girondot via R-help
Hi everybody, I have some questions about the way that sub is working. I hope that someone has the answer: 1/ Why the second example does not return an empty string ? There is no match. subtext <- "-1980-" sub(".*(1980).*", "\\1", subtext) # return 1980 sub(".*(1981).*", "\\1", subtext) #

Re: [R] security using R at work

2018-08-09 Thread Rainer M Krug
I can not agree more, Barry. Very nicely put. Rainer > On 8 Aug 2018, at 18:10, Barry Rowlingson > wrote: > > On Wed, Aug 8, 2018 at 4:09 PM, Laurence Clark > wrote: >> Hello all, >> >> I want to download R and use it for work purposes. I hope to use it to >> analyse very sensitive data

Re: [R] security using R at work

2018-08-09 Thread Rainer M Krug
This can likely be answered for R itself, but R itself (without additional packages) is very limited. As soon as you install packages, it all depends on the package you install and if you trust the authors of these packages. As far as I know, there is no code checking for security on CRAN

[R] exponential day

2018-08-09 Thread Francis Boateng
Hi, Please, how can I determine parameters from exponential equation Example one: y = a*exp(-b*x); how do I determine �a� and �b�, as well as R-square from data sets. And also fitting y = a*exp(-b*x) into the data sets Assuming data sets A = (0,2,4,6,8,10) B = (1,0.8,0.6,0.4,0.2,0.1) Thanks