[R] Failing to install the rgl package

2023-01-26 Thread Tunga Kantarcı
Hi, I try to execute the seven lines of code below to plot a graph. But I am failing as the messages below show. Where am I going wrong? install.packages("rgl") library(rgl) y_hat = X%*%B_hat open3d(windowRect = c(100,100,900,900),family = "serif") color = rainbow(length(y_hat))[rank(y_hat)]

Re: [R] Replying to replies in the forum

2017-04-05 Thread Tunga Kantarcı
nd > reply-to-all to the message you want to reply to. The threading is managed > by hidden message ids, not subjects. > -- > Sent from my phone. Please excuse my brevity. > > On April 5, 2017 11:26:27 AM PDT, "Tunga Kantarcı" <tungakanta...@gmail.com> > wrote

Re: [R] Yield to maturity calculation - bndyield equivalent of MATLAB in R

2017-04-05 Thread Tunga Kantarcı
this and I should read about it. On Wed, Apr 5, 2017 at 7:28 PM, Marc Schwartz <marc_schwa...@me.com> wrote: > >> On Apr 5, 2017, at 11:34 AM, Tunga Kantarcı <tungakanta...@gmail.com> wrote: >> >> Thanks a lot Marc, for informing that R is object oriented, implying

Re: [R] Replying to replies in the forum

2017-04-05 Thread Tunga Kantarcı
hwa...@me.com> wrote: > >> On Apr 5, 2017, at 11:41 AM, Tunga Kantarcı <tungakanta...@gmail.com> wrote: >> >> OK I cannot figure this out clearly in the guidelines of posting. When >> I reply to a message I should out "Re:" in front of the subject lin

[R] Replying to replies in the forum

2017-04-05 Thread Tunga Kantarcı
OK I cannot figure this out clearly in the guidelines of posting. When I reply to a message I should out "Re:" in front of the subject line of the original post. So if the subject line of the original post it is "this is a post", then I should use "Re: this is a post" in the subject line, for my

Re: [R] Yield to maturity calculation - bndyield equivalent of MATLAB in R

2017-04-05 Thread Tunga Kantarcı
Thanks a lot Marc, for informing that R is object oriented, implying that one should always try to vectorise the code (although I am not so clear why this should be the case) but also for all the references you provide. __ R-help@r-project.org mailing

[R] Yield to maturity calculation - bndyield equivalent of MATLAB in R

2017-04-05 Thread Tunga Kantarcı
I have the MATLAB code pasted below that calculates yields to maturity. IRR = zeros(length(c),length(M)) The ith row and jth column is the price of the bond with coupon c(i) and maturity M(j). for i = 1:3 for j = 1:3 if j == 1 IRR(i,j) =

Re: [R] Converting date vector into a serial date number

2017-04-04 Thread Tunga Kantarcı
Marc, thank you for this excellent answer. __ 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

[R] Converting date vector into a serial date number

2017-04-04 Thread Tunga Kantarcı
I have a data frame. One column (call this column a) contains years, like 1871, and another column (call this column b) contains months, like 2. I need to convert these year-month combinations, stored in these two date vectors, into a single serial date number. E.g. year 1871 and month 2, stored

Re: [R] Selecting rows and columns of a data frame using relational operators

2017-03-02 Thread Tunga Kantarcı
Thank you for all the helpful answers. Tunga __ 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

[R] Selecting rows and columns of a data frame using relational operators

2017-03-02 Thread Tunga Kantarcı
Thank you for all the helpful answers. Tunga __ 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

[R] Selecting rows and columns of a data frame using relational operators

2017-02-27 Thread Tunga Kantarcı
Consider a data frame named data. data contains 4 columns and 1000 rows. Say the aim is to bring together columns 1, 2, and 4, if the values in column 4 is equal to 1. We could use the syntax data(data[,4] == 1, c(1 2 4)) for this purpose. Suppose now that the aim is to bring together columns 1,

[R] How to automatically create data frames from an existing one?

2017-01-11 Thread Tunga Kantarcı
I have a data frame that includes several columns representing variables and variables names are indicated at the top row of the data frame. That is, I had a csv file where variable names were stored in the top row, and when I imported the csv file to R, R created a data frame that appears with

[R] Delete the first instances of the unique values of a vector in R

2017-01-11 Thread Tunga Kantarcı
Consider a data frame which I name as rwrdatafile. It includes several variables stored in columns. For each variable there are 1000 observations and hence 1000 rows. The interest lies in the values of the second column of this data frame, that is in rwrdatafile[,2]. What I am trying to accomplish