Displaying 20 results from an estimated 30000 matches similar to: "Convert date/time string to date"
2012 Mar 13
4
Converting factor data into Date-time format
Dear R-user,
I have read a dataset from .csv file into R. This dataset includes one
column containing some data in 'date and time' format, e.g. 'dd/mm/yyyy
hh:mm'.
These data were automatically read and saved as 'factor' in R. When I was
trying to produce some plots (such as time series) with the above 'date and
time' on x-axis, it caused some disodering problem,
2009 Jan 12
2
How to reference previous row?
I am trying to write some code where the factor references its
previous value, but can't find a solution searching through the
archive.
> X
first second
1 A 1
2 A 2
3 B 3
4 B 4
5 B 5
6 C 6
7 C 7
I need a third column, in pseudo code-
If value of first=previous value of first:
third=previous value of third
else third =
2009 Sep 22
3
how to convert character string with only month and year into date
Dear R helpers.
I am new to plotting time data using R.
wonder how to convert character time info into date in R.
I searched over the web but did not find answer.
the input character string is something like 03_1993 or 03-1993, so the
precision is at month level. I tried the following but failed.
#R code below.
strptime(c("03_1993"),"%m_%Y")
2010 Jun 18
5
extract date time from a text file
I a have a text file where every line is like that:
"2007-12-03 13:50:17 Juan Perez"
("yy-mm-dd hh:mm:ss First Name Second Name")
I would like to make a data frame with two column one for date and the
other one for name.
When I use read.delim it was transformed in a data frame with 4 colums.
Bye,
Sebasti?n.
2010 Feb 01
3
Convert a column of numbers to a column of strings
Hello,
Please excuse me if this question has been asked before. I'm new to R, and
have been trying to google the answers without any success.
I would like to convert a set of date and time into R date-time class. Right
now, the dates and times are in integer format, so I first need to convert
them into string, and then to R date-time using strptime. However, I have a
problem converting them
2011 Aug 17
3
Convert week value to date
Hello all,
I'm hoping to convert a decimal value for week of the year back to a date object.
Eg:
strptime(paste(2010,1:52,sep=" "),format="%Y %W")
I expected (hoped?) this would give me the date for Monday of each week. Instead, it's giving me 52 values of today's date.
Where am I erring?
Thanks
Michael
_______________________________________________________
2007 Mar 23
4
Conversion from string to date type
Hi,
I'm on my very first steps to R and so I hope that I do
not ask a really stupid questions but I did not found it
via R-Search, in the FAQ or Google (BTW, the name "R" is
not a really good seekiong criterion ;-) ).
I have a data file containing a table that containes
dates and values like
date\t value1\t value2, ...
01.03.2007\t 17\t 42\t ...
02.03.2007\t 2\t 3\t ...
2006 Mar 11
2
how to create analog stripchart plots of x vs t (t=mm/dd/yyyy hh:mm:ss)
Hello r-experts,
I sure could us a little help.
I have an ever updating text file with timestamped data in it. I can
reformat in anyway I want if need be but currently I have chosen to make
columns of date, time and measuresed value (comma delimeted and with the
dates and times in quotes to interpret them as strings).
Here is a small section of my text data file:
2011 Sep 08
2
help subsetting data based on date AND time
Dear R Community,
I am new to R, and have a question that I suspect may be quite simple but is
proving a formidable roadblock for me. I have a large data set that
includes water-quality measurements collected over many 24-hour periods.
The date and time of sample collection are in a combined Date/Time field in
the format yyyy-mm-dd hh:mm:ss. I need to be able to subset the data for
analysis of
2009 Mar 31
4
Convert Character to Date
Hello,
I have a date in the format Year-Month Name (e.g. 1990-January) and R classes it as a character. I want to convert this character into a date format, but when I try as.Date(1990-January, "%Y-%B"), I get back NA. The function strptime also gives me NA back. Thanks.
[[alternative HTML version deleted]]
2006 Mar 14
2
Date problem
Hello,
I have some "stupid" problems managing "date" data.
I have a colomn "date", which I converted from a character representation:
for example:
a="26/02/06"
date=strptime(a,format="%d/%m/%y")
For one part of the analysis, I'm interested only in the month and the
year, so I did:
m.y=strftime(date,format="%m/%y")
This returns me
2009 Nov 04
1
Convert H:MM:SS PM /AM into 24 HR syntax
I've got an array of times in H:MM:SS PM/AM format, e.g. "5:27:15 PM" (no leading zero), and I would like to convert them over to 24 HR syntax, e.g. HH:MM:SS.
If it matters, the times are from the Central Time zone.
Is there a command to convert the time to a 24HR format?
I tried the following:
ptime("5:27:15 PM", "%H:%M:%S")
[1] "2009-11-04
2009 Apr 29
1
Data type question: converting dates
I have a text (csv) file) with two columns: dates and numeric measurements.
I read it using read.table and the dates get read as a factor, with as many
levels as there are dates in the data. How can I create a matrix-like data
structure (data frame?) which has one column of “real” dates (a vector of
dates, not a factor variable) and one column of the numeric measurements?
The strptime function
2008 Mar 06
1
can't merge zoo ojects and convert to ts (been trying for 2 days)
I'm stuck, but am sure it can be done I just don't understand how.
I have data in an irregular timeseries. I want to be able to use stl to
visualise the data (see seasonal parts etc), so I need to change to regular
series of class ts (I think).
I am using 2 zoo objects one is regular and the other is my irregular data.
I am then merging to create the object I want but when I try to change
2023 Nov 05
3
strptime with +03:00 zone designator
I have some data that includes timestamps like this:
2017-02-28T13:35:00+03:00
The documentation for strptime says that %z expects
an offset like 0300. I don't see any way in the documentation
to get it to accept +hh:mm with a colon separator, and
everything I tried gave me NA as the answer.
Section 4.2.5.1 of ISO 8601:2004(E) allows both the
absence of colons in +hh[mm] (basic format) and
2012 Jan 17
2
Which date format to choose?
R offers a bewildering array of options when it comes to representing
dates and times (e.g, as.Date, chron, strptime, zoo, etc). Can anybody
recommend a document that compares the relative merit of each method? I'm
not looking for help with any one method, but rather a guide that
describes which method is best for a particular data analysis/plotting
goal.
Thanks,
Jake
[[alternative
2010 Jul 07
3
Need help in handling date
Dear all, I have a date related question. Suppose I have a character string
"March-2009", how I can convert it to a valid date object like
as.yearmon("2009-01-03") in the zoo package? Is there any possibility there?
Ans secondly is there any R function which will give the names of of all
months as "LETTERS" does?
Thanks for your time.
[[alternative HTML version
2013 Apr 26
3
converting character matrix to POSIXct matrix
I thought this is a common question but rseek/google searches don't yield
any relevant hit.
I have a matrix of character strings, which are time stamps,
> time.m[1:5,1:5]
[,1] [,2] [,3] [,4] [,5]
[1,] "08:00:20.799" "08:00:20.799" "08:00:20.799" "08:00:20.799"
"08:00:20.799"
[2,]
2010 Feb 16
3
converting character vector "hh:mm" to chron or strptime 24 clock time vectors
Hi All,
I am attempting to work with some data from loggers. I have read in a
.csv exported from MS Access that already has my dates and times (in 24
clock format), (with StringsAsFactors=FALSE).
> head(tdata)
LogData date time
1 77.16 2008/04/24 02:00
2 61.78 2008/04/24 04:00
3 75.44 2008/04/24 06:00
4 89.43 2008/04/24
2009 Jul 11
2
Date conversions
Hi all,
I'm having a little bit of trouble with some date conversions and
am hoping someone can help me out. Thanks in advance.
OK, I have two sources of data that provide date info in a csv file
differently. I've attached a small zipped file with two text files
that illustrate both. (Is it ok to send attachments to this list? Not
sure. It's very small.) I need to be able to