[R] Having problems with the ifelse and negative numbers

2019-12-09 Thread rsherry8

Please consider the following two R statements:
A =  runif(20, min=-1,max=1)
ifelse( A < 0, sqrt(-A), A )

The second statement produces the following error message:
rt(-A) : NaNs produced

I understand that you cannot take the square root of a negative number 
but I thought the condition A < 0

would take care of that issue. It appears not to be.

What am I missing?

Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Reading an excel file

2019-01-10 Thread rsherry8
The way I have done it in the past is to convert to an CSV file. One 
advantage of this approach is that should my
r script accidental write to the file, my original Excel file is not 
damaged.


Bob Sherry

On 1/10/2019 4:39 PM, Bernard Comcast wrote:

What is the best way to read in data of any type from an Excel 2016 .xlsx file?

Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Problem with LM

2018-12-18 Thread rsherry8

Richard,

It is now working.

Thank you very much.

Bob
On 12/18/2018 7:10 PM, Richard M. Heiberger wrote:

## This example, with your variable names, works correctly.

z2 <- data.frame(y=1:5, x=c(1,5,2,3,5), x2=c(1,5,2,3,5)^2)
z2
class(z2)
length(z2)
dim(z2)

lm(y ~ x + x2, data=z2)

## note that that variable names y, x, x2 are column names of the
## data.frame z2

## please review the definitions and examples of data.frame in ?data.frame
## also the argument requirements for lm in ?lm

On Tue, Dec 18, 2018 at 6:32 PM rsherry8  wrote:

The values read into z2 came from a CSV file. Please consider this R
session:

  > length(x2)
[1] 1632
  > length(x)
[1] 1632
  > length(z2)
[1] 1632
  > head(z2)
[1] 28914.0 28960.5 28994.5 29083.0 29083.0 29083.0
  > tail(z2)
[1] 32729.65 32751.85 32386.05 32379.75 32379.15 31977.15
  > lm ( y ~ x2 + x, z2 )
Error in eval(predvars, data, env) :
numeric 'envir' arg not of length one
  > lm ( y ~ x2 + x, as.data.frme(z2) )
Error in as.data.frme(z2) : could not find function "as.data.frme"
  > lm ( y ~ x2 + x, as.data.frame(z2) )
Error in eval(predvars, data, env) :
numeric 'envir' arg not of length one
lm(formula = y ~ x2 + x, data = as.data.frame(z2))

Coefficients:
(Intercept)   x2x
   -1.475e-091.000e+006.044e-13

  > min(z2)
[1] 24420
  > max(z2)
[1] 35524.85
  > class(z2)
[1] "numeric"
  >

where x is set to x = seq(1:1632)
and x2 is set to x^2

I am looking for an interpolating polynomial of the form:
  Ax^2 + Bx + C
I do not think the results I got make sense. I believe that I have a
data type error.  I do not understand why
I need to convert z2 to a data frame if it is already numeric.

Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Problem with LM

2018-12-18 Thread rsherry8
The values read into z2 came from a CSV file. Please consider this R 
session:


> length(x2)
[1] 1632
> length(x)
[1] 1632
> length(z2)
[1] 1632
> head(z2)
[1] 28914.0 28960.5 28994.5 29083.0 29083.0 29083.0
> tail(z2)
[1] 32729.65 32751.85 32386.05 32379.75 32379.15 31977.15
> lm ( y ~ x2 + x, z2 )
Error in eval(predvars, data, env) :
  numeric 'envir' arg not of length one
> lm ( y ~ x2 + x, as.data.frme(z2) )
Error in as.data.frme(z2) : could not find function "as.data.frme"
> lm ( y ~ x2 + x, as.data.frame(z2) )
Error in eval(predvars, data, env) :
  numeric 'envir' arg not of length one
lm(formula = y ~ x2 + x, data = as.data.frame(z2))

Coefficients:
(Intercept)   x2x
 -1.475e-091.000e+006.044e-13

> min(z2)
[1] 24420
> max(z2)
[1] 35524.85
> class(z2)
[1] "numeric"
>

where x is set to x = seq(1:1632)
and x2 is set to x^2

I am looking for an interpolating polynomial of the form:
Ax^2 + Bx + C
I do not think the results I got make sense. I believe that I have a 
data type error.  I do not understand why

I need to convert z2 to a data frame if it is already numeric.

Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Problem with Plotting in R

2018-12-18 Thread rsherry8



Please consider the following R statements:

> x = seq(1:1632)
> length( MyData$NWorth )
[1] 1632
> length( MyData$NWorthSm )
[1] 1632
> plot( x, MyData$NWorth, type="l" )
> plot( x, MyData$NWorthSm, type="l" )
> plot( x, MyData$NWorth, MyData$NWorthSm, type="l" )

All of the above statements work except for the last one. The last one 
produces the following message:


Error in plot.window(...) : invalid 'xlim' value

So I then tired this:

> xlim1 = c(0, 5000)
>plot( x, MyData$NWorth, MyData$NWorthSm, type="l", xlim = xlim1 )

Which produced the following error message:
Error in plot.window(...) : invalid 'ylim' value

So, I tired this:
> ylim1 = c(0,9000)
> plot( x, MyData$NWorth, MyData$NWorthSm, type="l", xlim = xlim1, 
ylim = ylim1 )


Which produced the following error message:
Error in strsplit(log, NULL) : non-character argument

I would like to know what I am doing wrong.

Thank you,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] For Loop

2018-09-22 Thread rsherry8



It is my impression that good R programmers make very little use of the 
for statement. Please consider  the following

R statement:
for( i in 1:(len-1) )  s[i] = log(c1[i+1]/c1[i], base = exp(1) )
One problem I have found with this statement is that s must exist before 
the statement is run. Can it be written without using a for

loop? Would that be better?

Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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

2018-08-10 Thread rsherry8

Duncan,

Since you asked, here is an updated version of my function.

# This method gets the Data.
getReturns1 <- function(symbol, norm = FALSE)
{
library(quantmod)

series = getSymbols(symbol, src = "yahoo", from = start, to = end, 
auto.assign = FALSE)

length <- nrow(  series )
close <- as.numeric(series[, paste0(symbol, ".Close")])
cat( "length = ", length(close ), "\n" )
diff = seq(1:(length-1))
for( i in 1:length-1 )
diff[i] = ((close[i+1] - close[i]) ) / close[i]
u = mean(diff)
stdDev = sd(diff)
cat( "stdDev = ", stdDev, "\n" )

if ( norm == TRUE ) {
diff = (diff - u)
diff = diff / stdDev
}
cat( "length = ", length(diff ), "\n" )

return (diff)
}

I believe it is now working correctly. I did add the following statement:
diff = seq(1:(length-1))
I thank you for your help. I also think the version of the function
posted by Joshua Ulrich is better. I found his post to be very educational.

Bob

On 8/9/2018 6:48 PM, Duncan Murdoch wrote:

On 09/08/2018 6:21 PM, rsherry8 wrote:

Duncan,

You are right and when I run with auto.assign=FALSE it works.


You should post your working version of the function to the mailing list.

Duncan Murdoch



Thank you very much,
Bob

On 8/9/2018 6:11 PM, Duncan Murdoch wrote:

On 09/08/2018 4:56 PM, rsherry8 wrote:

Duncan,

Thanks for the response. I tired the following:
   >  series <- getSymbols("AVB", src = "yahoo", from = start, to
= end)


You missed the auto.assign=FALSE argument.


   > 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 command to
tell me about the structure of series. I tried: typeof( series ) and
got: "character". Is there a better command for
me to use other than typeof?


Won't help here, but often str() is more informative than typeof().

Duncan Murdoch



I also tried this command:
   c1 <- as.numeric(series[, paste0(symbol, ".Close")])
where symbol held the value "AVB" and I got:
   Error in series[, paste0(symbol, ".Close")] :
   incorrect number of dimensions

Please help.
Thanks,
Bob

On 8/9/2018 3:51 PM, Duncan Murdoch wrote:

On 09/08/2018 1:12 PM, rsherry8 wrote:


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 = as.numeric( AVB$AVB.Close )
cat( "length = ", length(close ), "\n" )
for( i in 1:length-1 )
diff[i] = ((close[i+1] - close[i]) ) / close[i]
u = mean(diff)
stdDev = sd(diff)
cat( "stdDev = ", stdDev, "\n" )

if ( norm == TRUE ) {
diff = (diff - u)
diff = diff / stdDev
}
return (diff)
}

I would like to generalize it to work for any stock by passing in 
the

stock symbol. So the header for the
function would be:

getReturns <- function(symbol, norm = FALSE)


The quantmod function getSymbols has arguments auto.assign which
defaults to TRUE.  Set it to FALSE, and then keep the result of the
call, instead of assuming that a variable named AVB has been created.

That is,

 series <- getSymbols(symbol, src = "yahoo", from = start, 
to =

end, auto.assign = FALSE)
 length <- nrow(  series )

It will still name the columns according to the symbol, so you would
also need

close <- as.numeric(series[, paste0(symbol, ".Close")])

Duncan Murdoch



Now how do I update this line:
length = length(  AVB$AVB.Close )
This statement will not work:
length = length(  symbol$AVB.Close )
because the name that holds the closing price is a function of the
stock
symbol.

Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
















__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 class(AVB)?

Peter
On Thu, Aug 9, 2018 at 2:24 PM rsherry8  wrote:

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 3:46 PM, Peter Langfelder wrote:

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 to modify the names of the components
you retrieve from the list AVB. For that, you can use
AVB[["AVB.Close"]] instead of AVB$AVB.Close. You can them use
something like AVB[[paste0(symbol, ".Close"]] to generalize the
retrieval of list components.

HTH,

Peter
On Thu, Aug 9, 2018 at 12:40 PM rsherry8  wrote:

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 = as.numeric( AVB$AVB.Close )
   cat( "length = ", length(close ), "\n" )
   for( i in 1:length-1 )
   diff[i] = ((close[i+1] - close[i]) ) / close[i]
   u = mean(diff)
   stdDev = sd(diff)
   cat( "stdDev = ", stdDev, "\n" )

   if ( norm == TRUE ) {
   diff = (diff - u)
   diff = diff / stdDev
   }
   return (diff)
}

I would like to generalize it to work for any stock by passing in the
stock symbol. So the header for the
function would be:

getReturns <- function(symbol, norm = FALSE)

Now how do I update this line:
   length = length(  AVB$AVB.Close )
This statement will not work:
   length = length(  symbol$AVB.Close )
because the name that holds the closing price is a function of the stock
symbol.

Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 command to
tell me about the structure of series. I tried: typeof( series ) and 
got: "character". Is there a better command for

me to use other than typeof?

I also tried this command:
c1 <- as.numeric(series[, paste0(symbol, ".Close")])
where symbol held the value "AVB" and I got:
Error in series[, paste0(symbol, ".Close")] :
incorrect number of dimensions

Please help.
Thanks,
Bob

On 8/9/2018 3:46 PM, Peter Langfelder wrote:

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 to modify the names of the components
you retrieve from the list AVB. For that, you can use
AVB[["AVB.Close"]] instead of AVB$AVB.Close. You can them use
something like AVB[[paste0(symbol, ".Close"]] to generalize the
retrieval of list components.

HTH,

Peter
On Thu, Aug 9, 2018 at 12:40 PM rsherry8  wrote:


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 = as.numeric( AVB$AVB.Close )
  cat( "length = ", length(close ), "\n" )
  for( i in 1:length-1 )
  diff[i] = ((close[i+1] - close[i]) ) / close[i]
  u = mean(diff)
  stdDev = sd(diff)
  cat( "stdDev = ", stdDev, "\n" )

  if ( norm == TRUE ) {
  diff = (diff - u)
  diff = diff / stdDev
  }
  return (diff)
}

I would like to generalize it to work for any stock by passing in the
stock symbol. So the header for the
function would be:

getReturns <- function(symbol, norm = FALSE)

Now how do I update this line:
  length = length(  AVB$AVB.Close )
This statement will not work:
  length = length(  symbol$AVB.Close )
because the name that holds the closing price is a function of the stock
symbol.

Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 3:46 PM, Peter Langfelder wrote:

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 to modify the names of the components
you retrieve from the list AVB. For that, you can use
AVB[["AVB.Close"]] instead of AVB$AVB.Close. You can them use
something like AVB[[paste0(symbol, ".Close"]] to generalize the
retrieval of list components.

HTH,

Peter
On Thu, Aug 9, 2018 at 12:40 PM rsherry8  wrote:


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 = as.numeric( AVB$AVB.Close )
  cat( "length = ", length(close ), "\n" )
  for( i in 1:length-1 )
  diff[i] = ((close[i+1] - close[i]) ) / close[i]
  u = mean(diff)
  stdDev = sd(diff)
  cat( "stdDev = ", stdDev, "\n" )

  if ( norm == TRUE ) {
  diff = (diff - u)
  diff = diff / stdDev
  }
  return (diff)
}

I would like to generalize it to work for any stock by passing in the
stock symbol. So the header for the
function would be:

getReturns <- function(symbol, norm = FALSE)

Now how do I update this line:
  length = length(  AVB$AVB.Close )
This statement will not work:
  length = length(  symbol$AVB.Close )
because the name that holds the closing price is a function of the stock
symbol.

Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 = as.numeric( AVB$AVB.Close )
cat( "length = ", length(close ), "\n" )
for( i in 1:length-1 )
diff[i] = ((close[i+1] - close[i]) ) / close[i]
u = mean(diff)
stdDev = sd(diff)
cat( "stdDev = ", stdDev, "\n" )

if ( norm == TRUE ) {
diff = (diff - u)
diff = diff / stdDev
}
return (diff)
}

I would like to generalize it to work for any stock by passing in the 
stock symbol. So the header for the

function would be:

getReturns <- function(symbol, norm = FALSE)

Now how do I update this line:
length = length(  AVB$AVB.Close )
This statement will not work:
length = length(  symbol$AVB.Close )
because the name that holds the closing price is a function of the stock 
symbol.


Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] security using R at work

2018-08-08 Thread rsherry8
I consider R to be secure. It is possible, but very unlikely, that there 
are some back door traps in R where somebody could access your data. 
There is no software that is 100% secure and R is not 100% secure.


Bob

On 8/8/2018 11:09 AM, 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 from our clients.

My question is:

If I install R on my work network computer, will the data ever leave our 
network? I need to know if the data goes anywhere other than our network, 
because this could compromise it's security. Is there is any chance the data 
could go to a server owned by 'R' or anything else that's not immediately 
obvious, but constitutes the data leaving our network?

Thank you

Laurence


--
Laurence Clark
Business Data Analyst
Account Management
Health Management Ltd

Mobile: 07584 556498
Switchboard:0845 504 1000
Email:  laurence.cl...@healthmanltd.com
Web:www.healthmanagement.co.uk

--
CONFIDENTIALITY NOTICE: This email, including attachments, is for the sole use of the 
intended recipients and may contain confidential and privileged information or otherwise be 
protected by law. Any unauthorised review, use, disclosure or distribution is prohibited. 
If you are not the intended recipient, please contact the sender, and destroy all copies 
and the original message.MAXIMUS People Services Limited is registered 
in England and Wales (registered number: 03752300); registered office: 202 - 206 Union 
Street, London, SE1 0LX, United Kingdom. The Centre for Health and Disability Assessments 
Ltd (registered number: 9072343) and Health Management Ltd (registered number: 4369949) are 
registered in England and Wales. The registered office for each is Ash House, The Broyle, 
Ringmer, East Sussex, BN8 5NN, United Kingdom. Remploy Limited is registered in England and 
Wales (registered number: 09457025); registered office: 18c Meridian East, Meridian 
Business Park, Leicester,

 Leicestershire, LE19 1WZ, United Kingdom.

--


--


#
Scanned by MailMarshal - M86 Security's comprehensive email content security 
solution.
Download a free evaluation of MailMarshal at www.m86security.com
#

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RQuantLib

2017-12-30 Thread rsherry8
Based upon comments I received on the R-Help list, I ran the following 
commands and got the following output:


>  drat::addRepo("ghrr")
>  install.packages("RQuantLib", type="binary")
Installing package into ‘C:/Users/rsher/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: unable to access index for repository 
https://ghrr.github.io/drat/bin/windows/contrib/3.4:
  cannot open URL 
'https://ghrr.github.io/drat/bin/windows/contrib/3.4/PACKAGES'

also installing the dependency ‘Rcpp’

trying URL 'https://cran.uib.no/bin/windows/contrib/3.4/Rcpp_0.12.14.zip'
Content type 'application/zip' length 4358936 bytes (4.2 MB)
downloaded 4.2 MB

trying URL 'https://cran.uib.no/bin/windows/contrib/3.4/RQuantLib_0.4.2.zip'
Content type 'application/zip' length 7259503 bytes (6.9 MB)
downloaded 6.9 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked
package ‘RQuantLib’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\rsher\AppData\Local\Temp\Rtmp0OoZCW\downloaded_packages

This time, I used the mirror in Europe rather than a mirror in the 
United States and it worked. I am wondering if that matters. I want to 
thank everybody for their help.


Bob Sherry


On 12/30/2017 12:44 PM, David Winsemius wrote:

On Dec 30, 2017, at 7:54 AM, rsherry8  wrote:

OA,

Thanks for the response. I downloaded the file RQuantLib_0.4.4.tar.gz
into a directory c:\r.zip on my Windows machine. I then ran the
following command and I received the following output:


install.packages("RQuantLib", lib="/r.zip/")

Warning message:
package ‘RQuantLib’ is not available (for R version 3.4.3)

The install.packages command should include repo=NULL when installing from local 
binary package, and it also should include type="source when the package is not 
binary.

I did not unpack the .gz file. Should I have?

Please comment.
Bob Sherry

On 12/30/2017 2:24 AM, Orvalho Augusto wrote:

Hi Bob,

I don't know what is the cause of your trouble but try this:
1. Download the zip of package.

2. And install it from local zip files. This you find on the Packages
menu.

Hope it helps
OA


On Fri, Dec 29, 2017 at 10:31 AM, rsherry8 mailto:rsher...@comcast.net>> wrote:

Joshua,

Thanks for the response. When you said at least version 3.4.0, I
upgraded to 3.4.2 which I believe is the current version. Now, I
attempted to install the package RQuantLib but it did not work.
Here is what I got:


install.packages("RQuantLib")

Installing package into ‘C:/Users/rsher/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning message:
package ‘RQuantLib’ is not available (for R version 3.4.2)


Please help.
Thanks,
Bob Sherry


On 12/28/2017 10:28 PM, Joshua Ulrich wrote:

On Thu, Dec 28, 2017 at 6:02 PM, rsherry8
mailto:rsher...@comcast.net>> wrote:

I have recently installed R on my new computer. I also
want to install the
package RQuantLib. So I run the following command and get
the following
output:

  install.packages("RQuantLib")

Installing package into
‘C:/Users/rsher/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning message:
package ‘RQuantLib’ is not available (for R version 3.2.4
Revised)

The package did not install. Am I doing something wrong.
Is the package
going to be updated for the latest version of R?

Windows binary packages are only built for the most current
(major)
version of R.  You need to upgrade to at least R-3.4.0, or you
will
have to install RQuantLib (and therefore QuantLib itself) from
source.

Thanks,
Bob

__
R-help@r-project.org <mailto:R-help@r-project.org> mailing
list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
<https://stat.ethz.ch/mailman/listinfo/r-help>
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
<http://www.R-project.org/posting-guide.html>
and provide commented, minimal, self-contained,
reproducible code.




__
R-help@r-project.org <mailto:R-help@r-project.org> mailing list --
To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
<https://stat.ethz.ch/mailman/listinfo/r-help>
PLEASE do read the pos

Re: [R] RQuantLib

2017-12-30 Thread rsherry8
Jeff,

I tired another mirror but that did not work. I tired the following two 
commands:

 > ap <- available.packages()
 > View(ap)

The output of the View command showed numerous packages available but it 
did not show RQuantLib.

Bob Sherry

On 12/30/2017 8:48 AM, Jeff Newmiller wrote:
> Sometimes that message appears when using a CRAN mirror that is not 
> up-to-date or has communication problems. Might also try another mirror.
> -- Sent from my phone. Please excuse my brevity. On December 30, 2017 
> 5:25:15 AM PST, Michael Dewey  wrote:
>> >Dear Bob
>> >
>> >In fact the current release is 3.4.3 I can think of no reason why that
>> >should matter here but it might be worth trying to upgrade to it.
>> >
>> >Michael
>> >
>> >On 29/12/2017 18:31, rsherry8 wrote:
>>> >>Joshua,
>>> >>
>>> >>Thanks for the response. When you said at least version 3.4.0, I
>>> >>upgraded to 3.4.2 which I believe is the current version. Now, I
>>> >>attempted to install the package RQuantLib but it did not work. Here
>> >is
>>> >>what I got:
>>> >>
>>> >>  > install.packages("RQuantLib")
>>> >>Installing package into ‘C:/Users/rsher/Documents/R/win-library/3.4’
>>> >>(as ‘lib’ is unspecified)
>>> >>Warning message:
>>> >>package ‘RQuantLib’ is not available (for R version 3.4.2)
>>> >>
>>> >>
>>> >>Please help.
>>> >>Thanks,
>>> >>Bob Sherry
>>> >>
>>> >>On 12/28/2017 10:28 PM, Joshua Ulrich wrote:
>>>> >>>On Thu, Dec 28, 2017 at 6:02 PM, rsherry8
>> >wrote:
>>>>> >>>>I have recently installed R on my new computer. I also want to
>>>>> >>>>install the
>>>>> >>>>package RQuantLib. So I run the following command and get the
>> >following
>>>>> >>>>output:
>>>>> >>>>
>>>>>> >>>>>   install.packages("RQuantLib")
>>>>> >>>>Installing package into
>> >‘C:/Users/rsher/Documents/R/win-library/3.2’
>>>>> >>>>(as ‘lib’ is unspecified)
>>>>> >>>>--- Please select a CRAN mirror for use in this session ---
>>>>> >>>>Warning message:
>>>>> >>>>package ‘RQuantLib’ is not available (for R version 3.2.4 Revised)
>>>>> >>>>
>>>>> >>>>The package did not install. Am I doing something wrong. Is the
>> >package
>>>>> >>>>going to be updated for the latest version of R?
>>>>> >>>>
>>>> >>>Windows binary packages are only built for the most current (major)
>>>> >>>version of R.  You need to upgrade to at least R-3.4.0, or you will
>>>> >>>have to install RQuantLib (and therefore QuantLib itself) from
>> >source.
>>>> >>>
>>>>> >>>>Thanks,
>>>>> >>>>Bob
>>>>> >>>>
>>>>> >>>>__
>>>>> >>>>R-help@r-project.org  mailing list -- To UNSUBSCRIBE and more, see
>>>>> >>>>https://stat.ethz.ch/mailman/listinfo/r-help
>>>>> >>>>PLEASE do read the posting guide
>>>>> >>>>http://www.R-project.org/posting-guide.html
>>>>> >>>>and provide commented, minimal, self-contained, reproducible code.
>>>> >>>
>>>> >>>
>>> >>
>>> >>__
>>> >>R-help@r-project.org  mailing list -- To UNSUBSCRIBE and more, see
>>> >>https://stat.ethz.ch/mailman/listinfo/r-help
>>> >>PLEASE do read the posting guide
>>> >>http://www.R-project.org/posting-guide.html
>>> >>and provide commented, minimal, self-contained, reproducible code.
>> >
>> >-- 
>> >Michael
>> >http://www.dewey.myzen.co.uk/home.html
>> >
>> >__
>> >R-help@r-project.org  mailing list -- To UNSUBSCRIBE and more, see
>> >https://stat.ethz.ch/mailman/listinfo/r-help
>> >PLEASE do read the posting guide
>> >http://www.R-project.org/posting-guide.html
>> >and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] RQuantLib

2017-12-30 Thread rsherry8
OA,

Thanks for the response. I downloaded the file RQuantLib_0.4.4.tar.gz 
into a directory c:\r.zip on my Windows machine. I then ran the 
following command and I received the following output:

 > install.packages("RQuantLib", lib="/r.zip/")
Warning message:
package ‘RQuantLib’ is not available (for R version 3.4.3)

I did not unpack the .gz file. Should I have?

Please comment.
Bob Sherry

On 12/30/2017 2:24 AM, Orvalho Augusto wrote:
> Hi Bob,
>
> I don't know what is the cause of your trouble but try this:
> 1. Download the zip of package.
>
> 2. And install it from local zip files. This you find on the Packages 
> menu.
>
> Hope it helps
> OA
>
>
> On Fri, Dec 29, 2017 at 10:31 AM, rsherry8  <mailto:rsher...@comcast.net>> wrote:
>
> Joshua,
>
> Thanks for the response. When you said at least version 3.4.0, I
> upgraded to 3.4.2 which I believe is the current version. Now, I
> attempted to install the package RQuantLib but it did not work.
> Here is what I got:
>
> > install.packages("RQuantLib")
> Installing package into ‘C:/Users/rsher/Documents/R/win-library/3.4’
> (as ‘lib’ is unspecified)
> Warning message:
> package ‘RQuantLib’ is not available (for R version 3.4.2)
>
>
> Please help.
> Thanks,
> Bob Sherry
>
>
> On 12/28/2017 10:28 PM, Joshua Ulrich wrote:
>
> On Thu, Dec 28, 2017 at 6:02 PM, rsherry8
> mailto:rsher...@comcast.net>> wrote:
>
> I have recently installed R on my new computer. I also
> want to install the
> package RQuantLib. So I run the following command and get
> the following
> output:
>
>   install.packages("RQuantLib")
>
> Installing package into
> ‘C:/Users/rsher/Documents/R/win-library/3.2’
> (as ‘lib’ is unspecified)
> --- Please select a CRAN mirror for use in this session ---
> Warning message:
> package ‘RQuantLib’ is not available (for R version 3.2.4
> Revised)
>
> The package did not install. Am I doing something wrong.
> Is the package
> going to be updated for the latest version of R?
>
> Windows binary packages are only built for the most current
> (major)
> version of R.  You need to upgrade to at least R-3.4.0, or you
> will
> have to install RQuantLib (and therefore QuantLib itself) from
> source.
>
> Thanks,
> Bob
>
> __
> R-help@r-project.org <mailto:R-help@r-project.org> mailing
> list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> <https://stat.ethz.ch/mailman/listinfo/r-help>
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> <http://www.R-project.org/posting-guide.html>
> and provide commented, minimal, self-contained,
> reproducible code.
>
>
>
>
> __
> R-help@r-project.org <mailto:R-help@r-project.org> mailing list --
> To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> <https://stat.ethz.ch/mailman/listinfo/r-help>
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> <http://www.R-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>
>


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] RQuantLib

2017-12-29 Thread rsherry8

Joshua,

Thanks for the response. When you said at least version 3.4.0, I 
upgraded to 3.4.2 which I believe is the current version. Now, I 
attempted to install the package RQuantLib but it did not work. Here is 
what I got:


> install.packages("RQuantLib")
Installing package into ‘C:/Users/rsher/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Warning message:
package ‘RQuantLib’ is not available (for R version 3.4.2)


Please help.
Thanks,
Bob Sherry

On 12/28/2017 10:28 PM, Joshua Ulrich wrote:

On Thu, Dec 28, 2017 at 6:02 PM, rsherry8  wrote:

I have recently installed R on my new computer. I also want to install the
package RQuantLib. So I run the following command and get the following
output:


  install.packages("RQuantLib")

Installing package into ‘C:/Users/rsher/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning message:
package ‘RQuantLib’ is not available (for R version 3.2.4 Revised)

The package did not install. Am I doing something wrong. Is the package
going to be updated for the latest version of R?


Windows binary packages are only built for the most current (major)
version of R.  You need to upgrade to at least R-3.4.0, or you will
have to install RQuantLib (and therefore QuantLib itself) from source.


Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.





__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] RQuantLib

2017-12-28 Thread rsherry8


I have recently installed R on my new computer. I also want to install 
the package RQuantLib. So I run the following command and get the 
following output:


>  install.packages("RQuantLib")
Installing package into ‘C:/Users/rsher/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning message:
package ‘RQuantLib’ is not available (for R version 3.2.4 Revised)

The package did not install. Am I doing something wrong. Is the package 
going to be updated for the latest version of R?


Thanks,
Bob

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.