Displaying 20 results from an estimated 500 matches similar to: "Something wierd with .save method"
2006 Jul 13
5
Relationships: one model referencing same table for different data sets?
Hi,
After I''ve saved, I want to display the Description from the Codes table that
corresponds with the ID in the Cause table.
Rails doesn''t seem to like that, because on my form, I have two sets of data in
combo boxes that come from the Codes table. So, in the show template, I can''t
do this:
Cause of Death: <%= @cause.code.description %>
Any ideas?
The
2006 Jul 17
5
Keeping attributes of two models in sync
Hi,
I have a Product and a corresponding Keyword (1:1 via belongs_to and
has_one). I want to ensure, that two attributes (:name) of the two
models alway stay in sync. What''s the easiest way to accomplish that?
I did play around with before_/after_save hooks and with
AR::Observers but in the end I''d always get infinite recursion...
Thanks,
Timo
2006 Jul 19
6
ActiveRecord::RecordNotSaved - bizarre behaviour.
Hi. I get a RecordNotSaved exception when trying to create a user record.
The error:
User Columns (0.005930) SHOW FIELDS FROM users
SQL (0.000465) BEGIN
SQL (0.000466) COMMIT
ActiveRecord::RecordNotSaved (ActiveRecord::RecordNotSaved):
...
As you can see, there''s no INSERT SQL generated, which is the root cause
of the problem.
In my user model, I have the following
2009 Mar 05
6
About before_* callbacks
Hi
I have an problem about before_* callbacks.
I have a model named: Event
And I don''t want anyone to destroy or update any records in Event
model.
So:
[code]
class ActiveRecord::Base
before_destroy :log_illegal_operations
before_update :log_illegal_operations
private
def log_illegal_operations
Event.create({:key => "illegal operation", :value =>
2009 Jul 08
3
Fitting a trend-line
Hi all,
I am new to R. How does one go about fitting a trend-line to a
scatter plot? Any help is appreciated.
Thanks and regards,
Anupam
[[alternative HTML version deleted]]
2023 Jun 29
3
Plotting factors in graph panel
Thanks, Pikal and Jim. Yes, it has been a long time Jim. I hope you have
been well.
Pikal, thanks. Your solution may be close to what I want. I did not know
that I was posting in HTML. I just copied the data from Excel and posted in
the email in Gmail. The data is still in Excel, because I have not yet
figured out what is a good way to organize it in R. I am posting it again
below as text. These
2006 Jan 03
2
Stopping a save from the before_save
What''s the better thing to do in a before_save if you don''t want the
save to continue?
raise an exception, or do an errors.add or both?
Thanks,
Chris Nolan.ca
http://kweschun.com/ - Do you have a Kweschun?
2024 Aug 09
1
WDI package commands timing out and not working
In the browser the link downloads immediately, in less than a second. I let
the command run in R for five minutes, using R Studio. Nothing happened.
On Fri, 9 Aug 2024 at 17:54, Ivan Krylov <ikrylov at disroot.org> wrote:
> ? Thu, 8 Aug 2024 12:43:23 +0530
> Anupam Tyagi <anuptyagi at gmail.com> ?????:
>
> > In open.connection(con, "rb") :
> > URL
2023 Jun 29
2
Plotting factors in graph panel
Okay. Here is a modification that does four single line plots.
at_df<-read.table(text=
"Income MF MF_None MF_Equity MF_Debt MF_Hybrid Bank_None Bank_Current
Bank_Savings Bank_NA
$10 1 3.05 29.76 31.18 36.0 46.54 24.75 25.4 3.307
$25 2 2.29 28.79 32.64 36.27 54.01 24.4 18.7 2.891
$40 3 2.24 29.51 34.31 33.94 59.1 25.0 29 13.4
$75 4 1.71 28.90 35.65 33.74 62.17 24.61 11.48 1.746
2003 Sep 10
2
Plot survey data
I am trying to make plots that take into account survey weights. This a
survey of the US population. To start with I want to explore the data using pairs,
plot, coplots and lattice. Are there specialized methods that handle survey
weights for plotting? Any pointers?
Anupam.
[[alternative HTML version deleted]]
2009 Aug 26
2
Help regarding frequency distribution Graphs
Hi all,
I am trying to construct a frequency distribution graph i.e.
suppose there is a variable *"k"* and it takes a range of values. What I
want to do is to plot *"P(k)" *(probability/frequency of finding a specific
value of *"k"*) vs *"k"*.I
would like to get a smooth curve between "P(k) vs k". I have already tried
2023 Jul 06
2
Plotting factors in graph panel
On Thu, 6 Jul 2023 at 15:21, Anupam Tyagi <anuptyagi at gmail.com> wrote:
>
> Btw, I think "lattice" graphics will provide a better solution than
> "ggplot", because it puts appropriate (space saving) markers on the axes
> and does axes labels well. However, I cannot figure out how to do it in
> "lattice".
You will need to convert Income to a
2023 Mar 23
1
loess plotting problem
Thanks, John.
However, loess.smooth() is producing a very different curve compared to the
one that results from applying predict() on a loess(). I am guessing they
are using different defaults. Correct?
On Thu, 23 Mar 2023 at 20:20, John Fox <jfox at mcmaster.ca> wrote:
> Dear Anupam Tyagi,
>
> You didn't include your data, so it's not possible to see exactly what
>
2023 Jul 07
1
Plotting factors in graph panel
Thanks! You are correct, the graphs look very similar, except ggplot is
scaling the text font to make it more readable. Is there a way to scale
down the x-axis labels, so they are readable?
On Fri, 7 Jul 2023 at 12:02, PIKAL Petr <petr.pikal at precheza.cz> wrote:
> Hallo Anupam
>
> I do not see much difference in ggplot or lattice, they seems to me
> provide almost identical
2023 Jul 07
1
Plotting factors in graph panel
Hallo Anupam
I do not see much difference in ggplot or lattice, they seems to me provide almost identical results when removing theme part from ggplot.
library(ggplot2)
library(lattice)
ggplot(TrialData4, aes(x=Income, y=Percent, group=Measure)) + geom_point() +
geom_line() + facet_wrap(~Measure)
xyplot(Percent ~ Income | Measure, TrialData4,
type = "o", pch = 16, as.table =
2023 Jun 28
2
Plotting factors in graph panel
Hello,
I want to plot the following kind of data (percentage of respondents from a
survey) that varies by Income into many small *line* graphs in a panel of
graphs. I want to omit "No Answer" categories. I want to see how each one
of the categories (percentages), "None", " Equity", etc. varies by Income.
How can I do this? How to organize the data well and how to
2006 Feb 21
2
ActiveRecord before_ callbacks question
Hi!
I need to set the primary key in a model and postgres table to something
different than id. View Edit and such works in the scaffolded
controller. However if I click in the controller below the list of data
onto New then I get an error message like this:
Showing app/views/admin/_form.rhtml where line #5 raised:
undefined method `nr_before_type_cast'' for
2010 Jan 08
1
Directory operations
Dear all,
I have this directory structure :
Dir1 Dir2 Dir3 Dir4 .........................
A.xml D.xml G.xml
B.xml E.xml H.xml
C.xml F.xml I.xml
Within each of these directories (Dir1, Dir2 etc) there are a num of xml
files (A.xml, B.xml etc).
What I want to do is to enter into the first directory read all the xml
files do certain operations
2009 Apr 22
1
Problems with old version of R
Hi all,
Presently I have R-2.6 version installed on my system. Because of
this I am unable to install certain packages.Will an "updatepackages()"
command help or would I have to uninstall the older version of R and then
install the newer versions ? Can anyone help me out ? Thanks in advance.
Anupam Sinha
[[alternative HTML version deleted]]
2009 May 29
1
problem with "ls" command
Hi all ,
I am facing some problems with 'ls' command. Whenever I use it I
get the following error :
ls("KEGG.db")
Error in as.environment(pos) :
no item called "KEGG.db" on the search list
ls("pkgname")
Error in as.environment(pos) :
no item called "KEGG.db" on the search list
and this is true for any package. Can anything be done