similar to: How to Transform a Factor Variable into a Date

Displaying 20 results from an estimated 2000 matches similar to: "How to Transform a Factor Variable into a Date"

2017 Jun 19
0
How to Transform a Factor Variable into a Date
A couple thoughts: 1. converting factors into dates often requires that they be converted to character first. 2. you don't really have dates; you have just months and years 3. therefore perhaps the as.yearmon() function in the zoo package could help library(zoo) my.factor <- factor("Feb 2017") as.yearmon(my.factor) ## gets around the factor-vs-character issue On Mon, Jun
2017 Nov 08
3
Adding Records to a Table in R
Dear Eric, Hope you are doing great. I also tried the following: #First I created the complete date sequence TransitDateFrame <- data.frame(TransitDate=seq(as.Date(dataset1[1,1]), as.Date(dataset1[nrow(dataset1),1]), by = "month")) #Then I did the merging dataset1NEW <- merge(TransitDateFrame, dataset1, by="TransitDate", all.x=TRUE) Now it has, as expected the
2017 Nov 01
3
Adding Records to a Table in R
Dear R friends, I am currently working with time series data, and I have a table(as data frame) that has looks like this (TransitDate are in format = "%e-%B-%Y") : TransitDate Transits CargoTons 1985-04-01 100 2500 1985-05-01 135 4500 1985-06-01 120 1750 1985-07-01 100 3750 1985-08-01 200
2017 Nov 01
0
Adding Records to a Table in R
Hi Paul, #First I set up some sample data since I don't have a copy of your data dtOrig <- as.Date( c("1985-04-01","1985-07-01","1985-12-01","1986-04-01")) dfOrig <- data.frame( TransitDate=dtOrig, Transits=c(100,100,500,325), CargoTons=c(1000,1080,3785,4200) ) #Generate the complete set of dates as a data frame dfDates<- data.frame(
2017 Nov 08
0
Adding Records to a Table in R
Hi Instead of attachments copy directly result of dput(TransitDateFrame) and dput(dataset1) to your email. Or, if your data have more than about 20 rows you could copy only part of it. dput(TransitDateFrame[,1:20]) dput(dataset1[,1:20]) Only with this approach we can evaluate your data in all aspects and provide correct answer. Cheers Petr > -----Original Message----- > From: R-help
2013 Mar 06
4
Issue when reading a table into R
Hello everyone, I was reading a table into R, and when trying to retrieve it the following message appeared: [ reached getOption("max.print") -- omitted 469376 rows ] Does this mean that R left out 469376 rows? Or R is taking those 469376 rows as well and the limitation is only for printing purposes? Thanks in advance for any help, Best regards, Paul [[alternative HTML version
2023 May 16
1
Recombining Mon and Year values
?s 21:29 de 16/05/2023, Jeff Reichman escreveu: > R Help > > > > I have a data.frame where I've broken out the year <dbl> and an ordered > month <ord> values. But I need to recombine them so I can graph mon-year in > order but when I recombine I lose the month order and the results are > plotted alphabetical. > > > > Year month
2013 Mar 09
4
Calculation with date
Hello again, Let say I have an non-negative integer vector (which may be random): Vec <- c(0, 13, 10, 4) And I have a date: > Date <- as.Date(Sys.time()) > Date [1] "2013-03-09" Using these 2 information, I want to get following date-vector: New_Vec <- c("2013-03-01", "2014-04-01", "2014-01-01", "2013-07-01") Basically the
2012 Oct 08
2
converting DOB format to age
Hi, I have a column of DOB in mm/dd/yyyy. I want to convert this format to age. Thanks a lot.   Best,Farnoosh Sheikhi [[alternative HTML version deleted]]
2023 May 16
3
Recombining Mon and Year values
R Help I have a data.frame where I've broken out the year <dbl> and an ordered month <ord> values. But I need to recombine them so I can graph mon-year in order but when I recombine I lose the month order and the results are plotted alphabetical. Year month mon_year <dbl> <ord> 2021 Mar Mar-2021 2021 Jan
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Basic algebra and exponentials/logs. I leave those details to you or another HelpeR. -- Bert On Sun, Aug 20, 2023 at 12:17?PM Paul Bernal <paulbernal07 at gmail.com> wrote: > Dear Bert, > > Thank you for your extremely valuable feedback. Now, I just want to > understand why the signs for those starting values, given the following: > > #Fiting intermediate model to get
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Dear Bert, Thank you for your extremely valuable feedback. Now, I just want to understand why the signs for those starting values, given the following: > #Fiting intermediate model to get starting values > intermediatemod <- lm(log(y - .37) ~ x, data=mod14data2_random) > summary(intermediatemod) Call: lm(formula = log(y - 0.37) ~ x, data = mod14data2_random) Residuals: Min
2023 Aug 20
2
Issues when trying to fit a nonlinear regression model
Dear Bert, Thank you so much for your kind and valuable feedback. I tried finding the starting values using the approach you mentioned, then did the following to fit the nonlinear regression model: nlregmod2 <- nls(y ~ theta1 - theta2*exp(-theta3*x), start = list(theta1 = 0.37, theta2 = exp(-1.8), theta3 =
2017 Jan 03
2
[R] Problems when trying to install and load package "rzmq"
Possibly so. However, the ZeroMQ libraries do exist for Windows, so it might be possible to get the package working there. However, CRAN probably won't have the libraries, so cannot produce a binary package, and it is also quite possible that the package author is not a Windows person. At the very least, you'll need some familiarity with the Windows toolchain and be prepared to apply a
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
Oh, sorry; I changed signs in the model, fitting theta0 + theta1*exp(theta2*x) So for theta0 - theta1*exp(-theta2*x) use theta1= -.exp(-1.8) and theta2 = +.055 as starting values. -- Bert On Sun, Aug 20, 2023 at 11:50?AM Paul Bernal <paulbernal07 at gmail.com> wrote: > Dear Bert, > > Thank you so much for your kind and valuable feedback. I tried finding the > starting
2017 Sep 12
3
Unable to load packages RODBC and RODBCext in R
Dear all, Hope you are doing great. I am currently using R version 3.4.1 ("Single Candle") and was trying to install packages RODBC and RODBCext using the following steps: > install.packages("RODBCext") Installing package into ?C:/Users/PaulBernal/Documents/R/win-library/3.4? (as ?lib? is unspecified) also installing the dependency ?RODBC? trying URL '
2012 May 01
2
How to Export an R outcome to an Excel Spreadsheet
Hello R community, I basically created a normal distribution with mean 2500 and standard deviation = 450 with a sample of size 50 and assigned that to a variable named genvar2 with the following command: genvar2<-rnorm(mean=2500, sd=450, n=50) Now, the output of genvar2 generates de following: [1] 2478.126 2671.259 2163.879 2440.796 2702.234 1871.514 2525.127 2830.688 [9] 2704.148 3464.478
2024 Jan 30
1
R interpreting numeric field as a boolean field
Hi Bert, Below the information you asked me for: nrow(mydataset) [1] 2986276 ######## sapply(mydataset, "class") $`Transit Date` [1] "POSIXct" "POSIXt" $`Market Segment` [1] "character" $`N?mero de Tr?nsitos` [1] "numeric" $`Tar No` [1] "character" $`Beam Range (Operations)` [1] "character" $`Operational Vessel Ranges
2010 Aug 13
3
transforming dates into years
Hello! If I have in my data frame MyFrame a variable saved as a Date and want to translate it into years, I currently do it like this using "zoo": library(zoo) as.year <- function(x) as.numeric(floor(as.yearmon(x))) myFrame$year<-as.year(myFrame$date) Is there a function that would do it directly - like "as.yearmon" - but for years? Thank you! -- Dimitri
2017 Sep 12
0
Unable to load packages RODBC and RODBCext in R
I don't use Windows, but this looks like a Windows permissions issue, no? You could try moving them yourself manually or create another library directory that R can access to put them in. ... or wait and hope for advice from someone who uses Windows to give you a definitive answer. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and