Displaying 20 results from an estimated 8000 matches similar to: "Date in dataframe manipulation"
2006 Mar 10
2
trimming a factor
Hi,
I have the following dataframe. The County Column has many empty spaces
at the end.
I want to cut out the empty space and put them back into the dataframe.
How can this be done?
> head(DailyCounty)
Date County GFCPer GFCEquip Acre nFires
Date2
1 2001-01-04 00:00:00 Appling 1 1 0.20 1
2001-01-04
2 2001-01-05 00:00:00 Appling
2006 Oct 23
3
Plotting Text on a graph
Hi,
I plotted 12 graphs on a page and output to a png file. I wanted to
have an overall title for all 12 graphs. What command can I use to do
this? Below is the code that plotted the 12 graphs in one page.
# FM10 by Month/ Export the plot to Wash2005FM10.png
png(file="Wash2005FM10.png",bg="white")
par(mfrow = c(3,4))
# Plot 12 Month of OFM10, FFM10
for(i in
2006 Oct 20
1
How to evaluate a Variable Name?
Hi,
I have a dataframe Wash2005, which has daily weather data. I am doing a
regression by month as follows:
# FM10 Regression by Month
# Plot 12 Month of OFM10, FFM10
for(i in 1:12) {
Temp <- subset (Wash2005, MM == i)
assign( paste('Wash2005FM10', strtrim(month.name[i],3),
sep=""),lm(Temp$FM10.1 ~ Temp$FM10))
}
Wash2005FM10Jan, Wash2005FM10Feb, etc holds the
2017 Dec 18
0
Finding center of mass in a hydrologic time series
Hi Eric,
the following works for me.
HTH,
Eric
library(EGRET)
StartDate <- "1990-10-01"
EndDate <- "2017-09-30"
siteNumber <- "10310000"
QParameterCd <- "00060"
Daily <- readNWISDaily(siteNumber, QParameterCd, StartDate, EndDate)
# Define 'center of mass' function
com <- function(x) {
match(TRUE, cumsum(x/sum(x)) > 0.5) -
2006 Mar 23
2
clogit question
Hi,
I am playing with
clogit(case~spontaneous+induced+strata(stratum),data=infert)
from clogit help file.
This line works.
1. But, why strata(stratum) doesn't have a coefficient like spontaneous
and induced?
2. When I remove strata(stratum) from the command, this function seems
to keep running forever. Why?
3. I think the equation for clogit looks like
P=1/(1+
2006 Sep 27
3
Converting text to numbers
Hi,
I have Forecast Class and Observed Class in a data matrix as below.
> Sample1
FCT OBS
1 1 5
2 2 4
3 3- 3+
4 3 3
5 3+ 3-
6 4 2
7 5 1
I want to find the difference between Observed and Forecast Classes.
How can I get this done?
I tried to following to convert the 1 through 5 classes, to 1 through 7
for both OBS and FCT column.
> Sample1$OBS2 <- Sample1$OBS
2017 Jun 23
0
MODISTools Help
##MODISTools example
library(MODISTools)
library(lubridate)
setwd('~/Documents/Modis data')
#####MODISTools with buffalo data
###Read in data rename for easier coding
tbdata <- read.csv('~/Desktop/All TB data for EVI, NDVI.csv')
firstobs <- subset(tbdata, capture.ID == 'B1-1108')
firstobs <- firstobs[,c(1,2,2,3,4)]
colnames(firstobs) <- c('id',
2006 Feb 08
6
can''t get date_select to work
Hi,
I render a couple of date_select fields, the HTML looks fine, I can
see the values submitted back to the server, but AR doesn''t pick them
up from the hash in Booking.new(params[''booking'']).
I''ve got a ''booking'' object with parameters product, startdate and
enddate.
HTML snippets:
<select
2008 Feb 27
2
All Day Events
I must be stupid because this cannot be this hard.
I''m trying to build an all day calendar event. In most clients it shows up as an entry at the top of the day rather than blocking out the whole day with an event.
I have a bit of code that looks like this...
cal.event do
dtstart DateTime.parse("#{startDate.year()}-#{startDate.month()}-#{startDate.day()}")
dtend
2006 Apr 25
1
Array of dates/times from time.now till nextweek
Hi,
I would like to make @dates in my controller.
I tried the following:
startdate = Time.now
enddate = startdate.next_week
for enddate > startdate
@dates << startdate
startdate = startdate.tomorrow
end
But I get an errormessage when I check the syntax:
"warning: useless use of a variable in void context"
Anyone?
Thanks!
Steven.
--
Posted via
2012 Nov 02
2
Date format conversion from "2012-09-20" to "2012:09:20"
Hi R,
How to get the range of values form startDate to lastDate as given below?.
#*****************************************************************
# Load historical data
#******************************************************************
library('quantmod')
endDate =Sys.Date()
startDate = as.Date(endDate-30, order="ymd")
dataspy = getSymbols("SPY", from = startDate,
2017 Dec 18
2
Finding center of mass in a hydrologic time series
Eric B's response provided just the kind of quick & simple solution I was
hoping for (appears as the function com below). However, I once again
failed to take advantage of the power of R and have reverted back to using
a for loop for the next step of the processing. The example below (which
requires the library EGRET for pulling an example dataset) works, but
probably can be replaced
2006 Jul 26
8
change text_field_tag class
in my booking / _form I have the following input fields : (startdate and
endate)
<div>
<label for="startdate">Booking Start Date</label><br />
<%= text_field_tag(''startdate'', @startdate, {:class => @startdateclass,
:readonly => "readonly", :maxlength => "25"} ) %>
<%= observe_field("startdate",
2005 May 31
2
POSIX problem
I am having trouble with creating a POSIXct object. If I create a variable
of class Date first out of the date part of my data, I am ok, but if I
just paste the date and time parts together and try and create the POSIXct
object, I have problems.
Here is a toy example created from the actual data which caused the
problem. I am using R 2.0.1 on Windows XP.
> # Data frame with dates and
2017 Jun 23
1
MODISTools Help
On 6/22/2017 7:05 PM, Caroline wrote:
> ##MODISTools example
> library(MODISTools)
> library(lubridate)
> setwd('~/Documents/Modis data')
>
> #####MODISTools with buffalo data
>
> ###Read in data rename for easier coding
> tbdata <- read.csv('~/Desktop/All TB data for EVI, NDVI.csv')
Since this dataset is only on your desktop it cannot help us
2006 Jul 06
3
Understanding date_select naming conventions
I am using the date_select helper to generate date select elements in a
form.
I notice that the generated HTML shows that these selects have the
following names:
Month: current_job[StartDate(2i)]
Day: current_job[StartDate(3i)]
Year: current_job[StartDate(1i)]
I''m assuming that the Xi identifiers somehow specify the appropriate
date part from a date or time value.
Can anyone
2008 Nov 19
2
Exclude holidays in a subset of dates?
Hi All,
I am iterating through dated materials, with variable start and end dates,
and would like to skip procedures everytime I encounter a weekend or
holiday. To do this, I thought the easiest way would be to create a
TRUE/FALSE vector corresponding to each day where it is TRUE if a workday,
and FALSE if a weekend or holiday.
So far I have been able to do this for weekdays:
startDate <-
2008 Feb 20
4
plotting every ith data point?
Hello, fellow R enthusiasts.
Ok, I've been racking my brain about this small issue, and between
searching the help archives and reading through the plot-related
documentation, I can't figure out how to achieve my desired endpoint
without some ugly, brute force coding.
What I would like to do is make a plot in which only a subset of my
data are plotted, but in regular intervals, such as
2005 May 26
2
warnings from hist(): parameter XXX couldn't be set in high-level plot functionN
Hello -
This is not a real problem, just an annoyance. Sometimes, but not always,
I get a set of strange warnings from hist(). Example follows.
############################
#Produce a histogram of start dates for a set of field measurements.
# I didn't reproduce all the dates, because not sure it's relevant, but
here's a sample.
# Note the invalid date in the fifth element.
>
2012 Feb 22
4
Week number from a date
Hi
My data looks like this
startDate="2008-06-01"
dateRange =c( "2008-10-01","2008-12-01")
Is there any method to find the week number from the startDate range
-----
Thanks in Advance
Arun
--
View this message in context: http://r.789695.n4.nabble.com/Week-number-from-a-date-tp4410223p4410223.html
Sent from the R help mailing list archive at Nabble.com.