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 condit
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 t
ote 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. Ple
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
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" )
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
g 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
o 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
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 me
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&
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 = a
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
, 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
t; >
>> >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,
&
t;
> 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
nto ‘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 inst
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
17 matches
Mail list logo