Displaying 20 results from an estimated 160 matches similar to: "help with ActiveRecord joins"
2007 Feb 20
1
Reshape (pivot) question
Hi R-users,
I have a data set like this (first ten rows):
id patient_id date code class eala ID1564262 1562 6.4.2006 12:00 5555 1
NA ID1564262 1562 6.4.2006 12:00 5555 1 NA ID1564264 1365 14.2.2006 14:35
5555 1 50 ID1564265 1342 7.4.2006 14:30 2222 2 50 ID1564266 1648 7.4.200614:30
2222 2 50 ID1564267 1263 10.2.2006 15:45 2222 2 10 ID1564267 1263
10.2.200615:45
3333 3 10 ID1564269 5646
2005 Jul 28
1
conversion from SAS
Hi, I wonder if anybody could help me in converting
this easy SAS program into R.
(I'm still trying to do that!)
PROC IMPORT OUT= WORK.CHLA_italian
DATAFILE= "C:\Documents and
Settings\carleal\My
Documents\REBECCA\stat\sas\All&nutrients.xls"
DBMS=EXCEL2000 REPLACE;
GETNAMES=YES;
RUN;
data chla_italian;
set chla_italian;
2007 Jun 12
1
Cron not taking valid entries?
I changed one of my cron entries in puppet from:
cron { nightly_restart:
command => "/etc/init.d/something restart >& /dev/null",
user => root,
minute => "0",
hour => "13",
monthday => "*",
month => "*",
2008 Mar 12
1
ftable and xtabs
Hoping someone can help me with xtabs and ftable. I'm trying to get a pair
of ftables (possibly more) next to each other. For example:
> dunhill_lights_xtab<-ftable(xtabs(grossedupobs ~ gender+age_group +
dunhill_lights, data = ciggs))
> dunhill_lights_xtab
dunhill_lights No Yes
gender age_group
Female
2007 Oct 07
2
Re-ordering factors
A small example before I begin my query:
> educ <- read.table(efile, header=TRUE)
> educ
Education Age_Group Count
1 IncompleteHS 25-34 5416
2 IncompleteHS 35-44 5030
3 IncompleteHS 45-54 5777
4 IncompleteHS 55-64 7606
5 IncompleteHS >64 13746
6 CompletedHS 25-34 16431
7 CompletedHS 35-44 1855
8 CompletedHS 45-54 9435
9
2009 Aug 25
4
table, xyplot, names, & loops
Hi R community,
I'm just starting out in R and have a basic question about xyplot and
tables. Suppose I had a table of data with the following names: Height,
Age_group, City. I'd like to plot mean Height vs Age_group for each City.
When I try to do the following:
> library(lattice)
> xyplot(mean(Height) ~ Age_group | City)
of course I get just one data point, the mean Height for
2003 Dec 29
5
include a file ?
ok, I've got yet another newbie question.
My extensions.conf is getting rather longish and I'm getting dizzy
moving back and forth editing this thing. Can I use the include command
to include a file in order to break extensions.conf up into more
manageable pieces ? Is breaking up the extension.conf file an OK thing
to do ?
Maybe something like this:
include
2010 Apr 12
10
Cron question
Hello,
Why the following lines doesn''t work?
cron { "app" :
command => ""nice -n -10 /usr/bin/php
/var/www/public_html/rotinas/rotinas.php 2>&1>> /var/log/app.log",
environment => "PATH=$PATH",
user => root,
hour => ''*'',
minute =>
2013 Oct 19
0
[Bug 10219] New: Warn if list files more than once
https://bugzilla.samba.org/show_bug.cgi?id=10219
Summary: Warn if list files more than once
Product: rsync
Version: 3.0.9
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P5
Component: core
AssignedTo: wayned at samba.org
ReportedBy: jidanni at jidanni.org
2012 Dec 14
1
format.pval () and printCoefmat ()
Hi List,
My goal is to force R not to print in scientific notation in the sixth column (rel_diff - for the p-value) of my data frame (not a matrix).
I have used the format.pval () and printCoefmat () functions on the data frame. The R script is appended below.
This issue is that use of the format.pval () and printCoefmat () functions on the data frame gives me the desired results, but coerces
2006 Sep 12
1
DateHelper doesn't handle MonthDays?
I was looking at using the date helper functions for inputing a date for
some records, and was highly disappointed to see that they will allow
the entry of an invalid date such as Sept 31.
It sure would be nice to see the days available change based on the
month selected so the user cannot enter an invalid date that must later
be reentered.
Does anyone know of a plugin or if anyone has
2006 Jun 21
3
Simple range question
I have a model with a datetime field called start_date. I''d like to do
a find on the model so that it returns only records with the start_date
equal to the current day.
Something like this:
@foos = Foo.find(:all,
:conditions => //?? start_date equal to today''s date
??// ] )
Thanks in advance for any help.
-------------- next part
2006 Feb 28
5
Problem with paginate, include and foreign keys
Hi all,
Solaris 10
Ruby 1.8.4
Rails 1.0.0
Postgres 8.1
postgres driver 0.7.1
I''m having a problem with getting paginate() to properly pick up an FK
constraint properly.
I don''t seem to have this issue with ActiveRecord, however. Consider:
create table start_dates (
id bigserial,
start_date date unique,
max_slots int default 40,
primary key (id)
);
create
2007 Jul 08
2
datetime_select, is creating an instance of the Time class
Hello
It seems that datetime_select, is creating an instance of the Time
class. Why would that be?
I found this while building a site where people can create vigils
(prayer vigils, peace vigils, etc). When I added a validation method
that compared start_date to created_at, it generated the error:
ArgumentError (comparison of Time with DateTime failed):
I was able to put a breakpoint in the
2006 Feb 28
1
Working with date_select ...
I am a little confused about the best way to work with date_select. I see that
in my views it generates a simple input form that allows for the entry of year,
month and date information. If I just leave it at that, great!
But what if now in the controller, I want to work with the date information. I
actually want to take the user input date and compute a new date some number of
days in the
2006 Apr 15
2
Multi-parameter assignment
Hi,
I''m trying to submit data from text boxes on a form to one variable in
my controller, in the same way that datetime_select has date(1i),
date(2i), etc for day, month, year, etc...
I''ve named my variables event[start_date(1i)] event[start_date(2i)] and
event[start_date(3i)] but this doesn''t seem to work and
event[:start_date] is blank ... any pointers would be
2007 Sep 11
2
How to search with range when I am using AAF
acts_as_ferret :fields => {
:name => {:},
:desc => {},
:start_date => {}
}
def start_date
self.start_datetime.strftime("%Y%m%d")
end
Now that I am strong start_date in YYYYMMDD format, I want to search for
all event in between 20070506 and 20070809
What will my query look like when I am using aaf. This one doesn''t work
2006 Mar 28
2
Fastest way of adding " " around multiline text in RADRAILS
lets say i have the following SQL in my database editor :
When i paste it into rad rails i have to add quotes and the ''+'' symbol
to the end of each line. It is very tedious. What is the best method?
select timesheets.employee,
sum(items.hours) as hours,
sum(items.hours*timesheets.cost)
as cost,
sum(items.hours*timesheets.charge*decode(activities.chargetype,0,1,0))
as charge,
2013 Mar 30
1
How to use group in nested associations
The below query fails:
Timesheet.joins(:time_entries).select("timesheets.*,
sum(time_entries.worktime) as total").group("timesheets.start_date")
The models have the following relations:
Timesheet < AR
has_many :activities, dependent: :destroy, inverse_of: :timesheet
has_many :time_entries, through: :activities
accepts_nested_attributes_for :activities,
2011 Apr 20
3
[test message] Can R replicate this data manipulation in SAS?
Apologies for troubling the list, but it is a test that
needs to be carried out. I am resending the message that
I sent earlier on behalf of Paul Miller, but with a
certain word used in the variables names of the SAS code
changed to a different word.
With thanks for your tolerance ...
Ted.
[*** PLEASE NOTE: I am sending this message on behalf of
Paul Miller:
Paul Miller <pjmiller_57 at