Displaying 20 results from an estimated 7000 matches similar to: "How to create a SQL query without ActiveRecord?"
2012 Jun 01
3
Add rank column to data frame as in SQL...
Hopefully this is an easy problem...
I'm trying to add a partitioned rank column to a data frame where the
rank is calculated separately across a partition by categories, the
way you could easily do in SQL. I found this solution in the archives
that looked like it might work:
http://tolstoy.newcastle.edu.au/R/e11/help/10/09/8675.html
The example has a data frame with several car companies,
2004 Jun 11
4
Regression query
Hi
I have a set of data with both quantitative and categorical predictors.
After scaling of response variable, i looked for multicollinearity (VIF
values)
among the predictors and removed the predictors who were hinding some of the
other significant
predictors. I'm curious to know whether the predictors (who are not
significant)
while doing simple 'lm' will be involved in
2007 Nov 12
2
specifying decimal places
hie
how do I specify the number of decuimal places for my calulations
thanks
__________________________________________________
[[alternative HTML version deleted]]
2006 Mar 30
6
MS SQL query strangeness for ActiveRecord in Rails
Hi,
I am currently trying to move my rubyonrails app from Linux to Windows
server utilizing MS SQL instead of MySQL due to "business" reason. All
my listing screen utilize a drop down list in each column to allow user
to "filter" the listing based upon the value chosen from the drop down
list. In the controller, I used find() method but with customized
parameters such as
2004 Jun 11
1
Regression query : steps for model building
Hi
I have a set of data with both quantitative and categorical predictors.
After scaling of response variable, i looked for multicollinearity (VIF
values) among the predictors and removed the predictors who were hinding
some of the
other significant predictors. I'm curious to know whether the predictors
(who are not significant) while doing simple 'lm' will be involved in
2006 Dec 14
8
ActiveRecord outside of rails
I have a few questions regarding using activerecord outside of rails.
Usage is with legacy databases, which gives rise to some of the
problems.
Probably the first, and most simple question though, is how to capture
the SQL log, with which I can hopefully figure the other stuff out.
I''m currently trying
ActiveRecord::Base.logger = Logger.new STDOUT
Based on random googles, but it
2005 Oct 17
8
Using active record for SELECT MAX(column) FROM ...
Hi,
Is there an easy way of querying an active record for a maximum column
value? I need to do queries like:
SELECT MAX(salary) FROM employees
TIA,
Jeroen
2005 Mar 29
6
Aggregating data (with more than one function)
I have the data similar to the following in a data frame:
LastName Department Salary
1 Johnson IT 56000
2 James HR 54223
3 Howe Finance 80000
4 Jones Finance 82000
5 Norwood IT 67000
6 Benson Sales 76000
7 Smith Sales 65778
8 Baker HR 56778
9 Dempsey HR 78999
10 Nolan
2010 Sep 16
3
get top n rows group by a column from a dataframe
Hi, is there an R function like sql's TOP key word?
I have a dataframe that has 3 columns: company, person, salary
How do I get top 5 highest paid person for each company, and if I have
fewer than 5 people for a company, just return all of them?
Thanks,
Richard
[[alternative HTML version deleted]]
2008 Jan 26
3
Comparison of aggregate in R and group by in mysql
Hi, netters,
First of all, thanks a lot for all the prompt replies to my earlier question about "merging" data frames in R.
Actually that's an equivalence to the "join" clause in mysql.
Now I have another question. Suppose I have a data frame X with lots of columns/variables:
Name, Age,Group, Type, Salary.
I wanna do a subtotal of salaries:
aggregate(X$Salary,
2006 Apr 09
16
Mapping to BigDecimals instead of Floats
Hi everyone,
I''m new to Rails and Ruby, and have been working my way through the Pickaxe
and Agile Rails books for the last week or so. With a background in payroll
apps I found that the default ActiveRecord mapping of decimal columns to
float variables really bothered me! Financial calcs need high levels of
accuracy and floats just don''t give you that.
I know there are a bunch
2011 Oct 24
4
Problem with svyvar in survey package
I am facing a problem with a function in survey package. The function svyvar
gives the estimated population variance from a given sampling scheme. I am
working with a data having more than four continuous variables. In order to
have have population total for all those cont. variables I have written in
the following format
svyvar(~var1+var2+var3+var4+var5+var6,data) ; var1,var2,...,var6 are 6
2010 Jul 23
3
Filtering in R
The dataframe is
id salary
100 500
101 600
102 700
103 800
how can i generate a subsets if salary>600?
--
View this message in context: http://r.789695.n4.nabble.com/Filtering-in-R-tp2299603p2299603.html
Sent from the R help mailing list archive at Nabble.com.
2007 Aug 30
5
Single plot multiple levels in x?
Plotting with 2 x axis?
One axis inside another, for example salary within state,
1-50 | 50 ? 100 | 100+ | 1- 50 | 50 -100 | 100+ | ? repeated bins for salary
AL ! AR ?? more states
The values are all stored with a single data frame. I have tried different things with the axis function and done many
2010 Jul 21
1
Obtaining the unmerged cases from one of the two data set
Dear "R Gurus",
I am having two dummy csv data sets A and B containing 19 and 15
cases/observations respectively. From the two data set 13 cases are
intersection. From one of the two (any) data set, How do I then retrieve
the unmerged data ? let's take A for example, six cases must appear in
our results. See the R codes below.
Please assist.
Looking forward to hearing
2011 May 04
3
Regexp question
I have a string like this
st <- "SELECT COUNT(empid), COUNT(mgrid), COUNT(empname),
COUNT(salary), FROM Employees"
How can I remove the last comma before the FROM statement?
-J
2007 Jan 10
6
Updating an attribute in db
Hello
I am a Ruby newbie, thus a rather simple question.
My list view shows table records and enables user to click a button in
order to change value of one attribute in given record. I use this code
to invoke a method from controller:
<%= button_to "Change", { :action => "edit", :id => prog.id_prog } %>
My method looks like this (just a simple one - to set the
2009 Dec 03
2
Formatting of numbers on y axis
Hello all. I have the following:
plot(salaries$yearID, salaries$salary, type='n', xaxt='n', xlab='',
yaxt='n', ylab='')
axis(1, at=unique(salaries$yearID), labels=unique(salaries$yearID), lwd=.25,
tck=-0.05)
axis(2, axTicks(2), format(axTicks(2), scientific = F))
Which nicely creates the Y axis with the raw numbers, which are in the range
of .5 - 7
2006 Jul 02
18
JOIN conditions
Hi,
how can I get Rails to generate SQL queries with conditions in the JOIN clause?
What I would want is:
SELECT * FROM people p
LEFT OUTER JOIN jobs j (p.job_id = j.id AND j.salary > 9999999)
I tried
People.find(:all, :include => ''jobs'', :conditions => ''jobs.salary > 9999999'')
but that generates
SELECT * FROM people p
LEFT OUTER
2013 Mar 15
1
numerics from a factor
A problem has been pointed out by a French user of the survival package and I'm looking
for a pointer.
> options(OutDec= ",")
> fit <- survfit(Surv(1:6 /2) ~ 1)
> fit$time
[1] NA 1 NA 2 NA 3
A year or two ago some test cases that broke survfit were presented to me. The heart of
the problem was numbers that were almost identical, where table(x) and unique(x) gave