Displaying 20 results from an estimated 900 matches similar to: "Anyone care for a braindump?"
2010 May 26
0
substitution in a function
I have the following function defined as below
match.trace <- function(dfobj, distance, day1, day2) {
day1 <- substitute(dfobj$day1); day1
day2 <- substitute(dfobj$day2)
distance <- substitute(dfobj$distance)
xx <- NULL
for (i in 0:10) xx[i+1] <- with(dfobj,
cor(Lag((day1-day1[1]),i), (day2-day2[1]), use='pair'))
i <- match(max(xx), xx)
with(dfobj, {
2001 Oct 26
3
question about anova() output
Hello,
I am getting output from anova() and summary(aov()) that depends on the
order of the factors in the fitted model object, and this has me baffled. I
see this dependency with the data.frame below but not with an example (table
6.4) from Montgomery's DOE book. This is with R 1.3.0 on Debian GNU-Linux.
Where have I gone wrong?
> centerpts
run sample CH50mg
1 day1 dev126 0.56
2
2008 Jul 31
2
S 3 generic method consistency warning please help
I would like to include this in a package. The S3 methods on R CMD check
says
* checking S3 generic/method consistency ... WARNING
window:
function(x, ...)
window.chron:
function(data, day1, hour1, day2, hour2, ...)
See section 'Generic functions and methods' of the 'Writing R Extensions'
manual.
I have looked and can not figure it out. This function is for convience.
What
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
2009 Jan 21
1
finding row and column indices of date in multiple columns of a data frame
Hi,
I have a data.frame SAMPLES with columns:
Site Site# Season Day1 Day2 Day3
Day1, Day2, Day3 are class "Date", the other columns are numeric or
factor.
I have a date "mydate" that may or may not be listed in my data.frame
and I need to find that out.
If "mydate" is there, I want to get the number of the data.frame row
where it occurs.
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",
2006 Jul 26
0
render :update do | page | to modify a css class string...
In my booking/_form.rhtml, I have 2 <input text fields>
startingdate (selction from unobstrusive calendar ) and endingdate
<div>
<label for="startdate">Booking Start Date</label><br />
<%= text_field_tag(''startdate'', @startdate, {:class =>
@startdateclass, :readonly => "readonly", :maxlength => "25"}
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,
2009 Sep 11
1
help with plotting
HI all,
raw_urine =
read.table("Z:\\bruce.9.3.09.sample.stability.analysis\\urine\\mz.spot.sam.dat.new",
header = TRUE )
pvalue =
read.table("Z:\\bruce.9.3.09.sample.stability.analysis\\urine\\all.urine.features.t.test.result",
header = TRUE )
library(compositions)
p = function(a,b){
y = pvalue[,a]
if(y<0.01){
index = which(y, arr.ind=TRUE)
day1 = raw_urine[index,3:7]
day2 =
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
2005 Jun 01
2
problem with chron scales in lattice
I can't get the scales parameter in xyplot of lattice to work as I
expected. I'm using R-2.1.0 and lattice 0.11-8. There should be year
labels from 1992 to 2004 for the x axis in the plot below, but instead
only a few of them appear, and in the wrong spots, as if the coordinate
system has changed after finishing with the panel function.
library(chron)
library(lattice)
# vertical grid
2011 Mar 23
1
using R variables in RMySQL query
I have the following function
myGetstockdataMySQL <- function(startdate, enddate, ticker) {
con <- dbConnect(MySQL(), user="blahblah", password="blahblah",
dbname="blahblah",
host="localhost")
rs <- dbGetQuery(con, "SELECT price.close FROM price INNER JOIN stocks ON
stocks.stock_id=price.stock_ID
WHERE (price.date_holding BETWEEN
2006 May 26
0
Hellp needed with sublist plugin
Is there somebody out there who has built a working thingy with the
Sublist plugin? I can''t get it to work. I get this error message:
undefined method `stringify_keys!'' for "2005":String
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
E:/Programmeren/Ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:1506:in
2006 May 16
1
:conditions on has_one realationship
Hi there,
I''m currently building a membership application and I want to be able
to select, not just all the memberships, but the most current
membership from the database on a per user basis. I have linked the
tables as shown:-
class Membership < ActiveRecord::Base
belongs_to :payment
belongs_to :person
end
class Person < ActiveRecord::Base
has_many :memberships
2006 Feb 06
4
Basic MVC in RoR question
Ok, Here''s my controller:
def create
trainingplan = Trainingplan.createplan(@params[:startdate],
@params[:enddate], @params[:hoursperweek], @params[:programtype])
end
My model is:
class Trainingplan <ActiveRecord::Base
def self.createplan(stardate, enddate, hoursperweek, programtype)
stardate = startdate
enddate = enddate
hoursperweek = hoursperweek
programtype
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 Jul 22
0
loop for multiple regressions
Dear all,
I have the following data in excel:
day1 y 1 2 3 2 3 x1 0.2 0.3 0.4 0.3 0.2 x2 7 3.4 2 8 6 day2 y 2 4 3
2 2 x1 0.4 0.5 0.3 0.3 0.2 x2 7 8 9.1 6 5
I have the following problems:
first of all, when I ask R to read the file (with the package xlsReadWrite
and the command read.xls) it has a problem with the fact that the left most
corner is labelled the same way, so in order for it
2007 Apr 03
2
Strange labels on plot with dates
Hello fellow R people,
I don't understand the default behavior of the axis labeling when
plotting dates.
I would expect something like 2001, 2002 or possibly Jan 01, Jan
02...Jan 06, but instead I only see Jan 01, Jan 01, Jan 01....
See the following example
startdate <- strptime("2001-01-01",format="%Y-%m-%d")
enddate <-
2012 Apr 09
1
Creating a dummy variable
HI
I want to create a dummy variable for a dataset which has various dates Eg
I've one year data. The user can choose any date range
startdate : 2012-01-01
enddate: 2012-02-01
startdate: 2012-06-01
enddate=2012-07-01
the columns of dataset= X ,Y ,date
Thanks and re
-----
Thanks in Advance
Arun
--
View this message in context:
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) -