Displaying 4 results from an estimated 4 matches for "tempdat".
Did you mean:
tempdata
2008 Jul 03
1
read.table, NA assignment, and sep
I place the following data in a file
id rs835 rs169 rs174
1001 CC GG CC
10032 CC GG CC
10066 CC NA CC
If I read it in as
tempDat <- read.table("tempDat.txt",na.strings="NA",header=TRUE)
I get the following.
id rs835 rs169 rs174
1 1001 CC GG CC
2 10032 CC GG CC
3 10066 CC <NA> CC
NA has been assigned a missing value.
If I add the separator
tempDat <- read.tab...
2010 Feb 01
3
Convert a column of numbers to a column of strings
...imes 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 from integer to string:
data:
Date Time
20091209 1200
20091209 1500
20091209 1800
....
20091210 800
20091210 1000
20091210 1600
....
I used:
tempdate=toString(Date)
day=substr(tempdate, 7, 8)
month=substr(tempdate, 5, 6)
year=substr(tempdate, 1, 2)
rDate=strptime(paste(year, month, day, sep="-"))
the 1st command does not create a new column with string dates in it, it
creates a single row that has all the dates in a single string, li...
2011 Jul 26
2
How to use as.Date (or something else) with "31-Jul-2010 23:59:00"
Hello
I have a huge file (not an R-file) in which the first column is a string
with date, hour, minutes and seconds (For instance, "31-Jul-2010 23:59:00").
I tried as.Date but the error msg was "Error in charToDate(x) :
character string is not in a standard unambiguous format".
I have checked the help for the function as well as date but to no avail.
How can that sort
2007 Dec 06
3
using "eval(parse(text)) " , gsub(pattern, replacement, x) , to process "code" within a loop/custom function
...;) gsub("a", "green", x) else x
}# end recurse end
#######################
#######################
#function that processes code submitted as "text.i" for each date in "dates.i"
fn.dateloop <- function(text.i, dates.i ) {
for(d in 1: length(dates.i) ) {
tempdate <- dates.i[d]
text.i2 <- recurse(text.i, pat.i='#', rep.i=tempdate)
temp0=eval(parse(t=text.i2))
tempname <- paste(names(temp0)[1], tempdate, sep='.')
save(list='temp0', file = tempname)
} # next d
} # end fn.dateloop
#######################
####################...