Re: [R] date

2019-12-17 Thread John Kane
library(lubridate) gs$dat1 <- mdy(gs$date) On Tue, 17 Dec 2019 at 18:38, peter dalgaard wrote: > > ...and switch the order, and use %y for 2-digit years. > > > On 17 Dec 2019, at 23:57 , Patrick (Malone Quantitative) > > wrote: > > > > Try putting / instead of - in your format, to match the d

Re: [R] date

2019-12-17 Thread peter dalgaard
...and switch the order, and use %y for 2-digit years. > On 17 Dec 2019, at 23:57 , Patrick (Malone Quantitative) > wrote: > > Try putting / instead of - in your format, to match the data. > > On Tue, Dec 17, 2019 at 5:52 PM Val wrote: >> >> Hi All, >> >> I wanted to to convert character da

Re: [R] date

2019-12-17 Thread Patrick (Malone Quantitative)
Try putting / instead of - in your format, to match the data. On Tue, Dec 17, 2019 at 5:52 PM Val wrote: > > Hi All, > > I wanted to to convert character date mm/dd/yy to -mm-dd > The sample data and my attempt is shown below > > gs <-read.table(text="ID date > A1 09/27/03 > A2 05/27/16

[R] date

2019-12-17 Thread Val
Hi All, I wanted to to convert character date mm/dd/yy to -mm-dd The sample data and my attempt is shown below gs <-read.table(text="ID date A1 09/27/03 A2 05/27/16 A3 01/25/13 A4 09/27/19",header=TRUE,stringsAsFactors=F) Desired output ID date d1 A1 09/27/03 2003-09-27

Re: [R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Jim Lemon
Okay, I'm away for most of the day and might not be able to look at it until tomorrow. Jim On Wed, Dec 18, 2019 at 9:27 AM Ioannou, Ioanna wrote: > > Hello Jim , > > I am very sorry. Here is the corrected sample data to play with: > > Test.v2 <- data.frame(Ref.No = c(1622, 1623, 1624, 1625, 162

Re: [R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Ivan Krylov
Hello Ioanna! Please don't post the same question 4 times in a row. One is just enough; you can see it posted successfully in the R-help archives: https://stat.ethz.ch/pipermail/r-help/2019-December/465108.html On Tue, 17 Dec 2019 19:38:02 + Ioanna Ioannou wrote: > VC <- 0.01*( subset(D, I

[R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Ioannou, Ioanna
Hello everyone, I have the following problem: I have a data.frame with multiple fields. If I had to do my calculations for a given combination of IM.type and Taxonomy is the following: D <- read.csv('Test_v2.csv') names(D) VC <- 0.01*( subset(D, IM.type == 'PGA' & Damage.state == 'DS1' & Taxono

[R] FW: How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread ioanna ioannou
Hello everyone, I have the following problem: I have a data.frame with multiple fields. If I had to do my calculations for a given combination of IM.type and Taxonomy is the following: D <- read.csv('Test_v2.csv') names(D) VC <- 0.01*( subset(D, IM.type == 'PGA' & Damage.state == 'DS1' & Taxo

Re: [R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Ioanna Ioannou
Just i case you cant see the data: Test.v2 <- data.frame(Ref.No = c(1622, 1623, 1624, 1625, 1626, 1627, 1628, 1629), IM.type = c('PGA', 'PGA', 'PGA', 'PGA', 'Sa', 'Sa', 'Sa', 'Sa'), Damage.state = c('DS1', 'DS2', 'DS3', 'DS4','DS1', 'DS2', 'DS3', 'DS4

[R] FW: How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Ioanna Ioannou
Hello everyone, I have the following problem: I have a data.frame with multiple fields. If I had to do my calculations for a given combination of IM.type and Taxonomy is the following: D <- read.csv('Test_v2.csv') names(D) VC <- 0.01*( subset(D, IM.type == 'PGA' & Damage.state == 'DS1' & T

[R] How to create a new data.frame based on calculation of subsets of an existing data.frame

2019-12-17 Thread Ioanna Ioannou
Hello everyone, I have the following problem: I have a data.frame with multiple fields. If I had to do my calculations for a given combination of IM.type and Taxonomy is the following: D <- read.csv('Test_v2.csv') names(D) VC <- 0.01*( subset(D, IM.type == 'PGA' & Damage.state == 'DS1' & Tax

[R] [R-pkgs] christmas package

2019-12-17 Thread Jose Barrera
Generation of a number of Christmas cards, most of them being animated. The name of each card includes the year in which it was created. Some examples are: - The christmas card that was writen in 2009 shows a “caganer” ( https://en.wikipedia.org/wiki/Caganer): > library(christmas) > xmas2009caga