similar to: Using 'field names' of a data.frame in a function

Displaying 20 results from an estimated 1000 matches similar to: "Using 'field names' of a data.frame in a function"

2006 May 28
3
Working with topics and categories
Hello guys, I''m a newbie in RoR and I have a problem. My DB structure is ====================================== topics table : id(int,11) name(varchar,255) categories : id (int,11) topic_id(varchar,255) name(varchar,255) ====================================== --Models:-- class Topic < ActiveRecord::Base has_many :categories end class
2008 Apr 01
1
Navigation Problems
Hi, I am having problems with my page. I have a banner and navigation bar in controller_name.rhtml in app/views/layout. Can someone please help? Thanks In the navigation bar, I have the following links: Category1 Sub-Category1 Sub-Category2 Sub-Category3 Sub-Category4 Sub-Category5 Sub-Category6 In the main content, I have the following links: Sub-Category1 edit delete
2009 Jul 28
5
Summarising Data for Forrest Plots
I tried to post this a few times last week and it seems to have got stuck somehow so I'm trying from a different email in the hope that works. If somehow this has appeared on the list 20 tiems and I never saw any of them I apologize ;-) I'm basically an R-newbie. But I am VERY computer literate. But this has me stumped... All the examples for using the rmeta package to create a
2010 May 25
1
Non-unique Values
I might be missing something really obvious, but is there an easy way to locate all non-unique values in a data frame? Example mydata <- numeric() mydata$id <- 0:8 mydata$unique <- c(1:5, 1:4) mydata$result <- c(1:3, 1:3, 1:3) > mydata $id [1] 0 1 2 3 4 5 6 7 8 $unique [1] 1 2 3 4 5 1 2 3 4 $result [1] 1 2 3 1 2 3 1 2 3 What I want to to be able to get some form of data output
2009 Aug 19
3
PowerCut Killed R - is my code retrievable?
I've been tweaking code for several days on and off in R, cut and pasting in from a text editor (I just leave them open all the time). I think I got something that was usable but then a powersurge tripped the fuses and unfortunately the machine I was working on doesn't have a UPS. Does R hold the command data in cache some place? I've purposefully not opened R since the crash so
2009 Jul 17
2
Count data categories from table
Hi there, I have a relatively simple question, though, I couldn't find a solution for it so far. I have a table with 1000 entries and columns containing information about different parameters for each entry. What I want to do is group all parameters from one of the columns [e.g. if all 1000 entries are grouped in 30 different categories (described as character strings) in a second column] and
2011 Oct 31
5
Kaplan Meier - not for dates
I have some data which is censored and I want to determine the median. Its actually cost data for a cohort of patients, many of whom are still on treatment and so are censored. I can do the same sort of analysis for a survival curve and get the median survival... ...but can I just use the survival curve functions to plot an X axis that is $ rather than date? If not is there some other way to
2010 Feb 21
1
odfWeave - merged table cells, and adding information like totals and p-values
I'm hoping I'm missing some (probably fundamental basic process) which might make my life easier! Lets assume I have a 3 column table summarizing results from a trial from three arms (Arm A, B and C). For each arm there will be a number of pieces of information to report. The simplest example might be to compare this to the demographic comparisons often seen in clinical traisl where you
2013 Apr 29
3
Comparing two different 'survival' events for the same subject using survdiff?
I have a dataset which for the sake of simplicity has two endpoints. We would like to test if two different end-points have the same eventual meaning. To try and take an example that people might understand better: Lets assume we had a group of subjects who all received a treatment. The could stop treatment for any reason (side effects, treatment stops working etc). Getting that data is very
2008 Dec 27
1
Want to create empty vectors inside a empty data frame
Hi All, I want to create empty vectors inside an empty data frame.The name of the vectors has to come dynamically. For example if record_mean is my empty data frame,and i have say 4 categories,the category names for record mean data frame has to recmeanC1,recmeanC2,recmeanC3,recmeanC4,which will be dynamically created and which will again be inserted in my data frame's as column values.Each
2008 Nov 14
3
migration with data
Hi I am using postgres and have two migration files like 001_create_categories.rb as class CreateCategories < ActiveRecord::Migration def self.up create_table :categories do |t| t.column :name, :string, :limit=>80 end end def self.down drop_table :categories end end and 002_populate_categories.rb class PopulateCategories < ActiveRecord::Migration
2007 Feb 25
0
moving local files, remote mirroring, and --link-dest awkwardness
I have some pictures that I unload from the camera into: dir/tmp and at night I automatically rsync all of dir/ to some remote:dir/ Then days or weeks later I do some local sorting, and I make lots of image moves of the sort where image dir/tmp/bar goes to to dir/category1/bar, possibly linked also into dir/category2/bar. Then rsync runs the next night, notices the "new" image
2010 May 25
2
Site Navigation With Polymorphic Has Many Through
Hi, seem to keep running into a wall here. I can''t find any resources on site navigation that can deal with any model being in the nav, allow nesting, and can dynamically update. So I thought about it for a while, and decided on a MenuItems class, which contained the position of the child in relation to it''s siblings, where the parent and the child were polymorphic. Then a given
2017 Jun 01
3
odfWeave - A loop of the "same" data
Before I go and do this another way - can I check if anyone has a way of looping through data in odfWeave (or possibly sweave) to do a repeating analysis on subsets of data? For simplicity lets use mtcars dataset in R to explain. Dataset looks like this: > mtcars mpg cyl disp hp drat wt ... Mazda RX4 21.0 6 160 110 3.90 2.62 ... Mazda RX4 Wag 21.0 6 160 110 3.90
2012 Jun 19
2
matchit - can I weight the parameters?
This may be a really obvious question but I just can't figure out how to do it. I have a small dataset that I am trying to compare to some controls. It is essential that the controls are matched on Cancer Stage (a numerical factor between 1 and 4), and then ideally on Age (integer), Gender (factor), Performance Status(factor). I'm using matchit to try and do this, but it seems to give
2009 Sep 14
2
Is there an equivalent of "echo"
Sorry I'm having one of those moments where I can't find the answer but I bet its obvious... I'm outputting my results to a file using sink() Is there a command simillar to php's echo command that would allow me to add some text to that file ie: dataFr$a = 1:10 dataFr$b = 2*1:10 sink ("filepath/filename.txt", split=T) #Show number of entries in vector a table
2009 Dec 18
1
?OT: Probabilistic Simulation
Sorry this may well be defined as Off Topic. I apologize in advance. I am interested in performing what I think would be a probabilistic sensitivity simulation. I've done some crude ones before in excel but I'm wondering if R can help me do it more effectively? I have a set of theoretical variables for simplicity lets use (what I think) is an easier example: I have a peg and a hole
2009 Sep 08
1
Obtaining value of median survival for survfit function to use in calculation
Hi, I'm sure this should be simple but I can't figure it out! I want to get the median survival calculated by the survfit function and use the value rather than just be able to print it. Something like this: library(survival) data(lung) lung.byPS = survfit(Surv (time, status) ~ ph.ecog, data=lung) # lung.byPS Call: survfit(formula = Surv(time, status) ~ ph.ecog, data = lung) 1
2017 Jun 01
0
odfWeave - A loop of the "same" data
On Thu, 1 Jun 2017, POLWART, Calum (COUNTY DURHAM AND DARLINGTON NHS FOUNDATION TRUST) via R-help wrote: > Before I go and do this another way - can I check if anyone has a way of > looping through data in odfWeave (or possibly sweave) to do a repeating > analysis on subsets of data? > > For simplicity lets use mtcars dataset in R to explain. Dataset looks like this: >
2023 Dec 30
1
Help request: Parsing docx files for key words and appending to a spreadsheet
Thanks Ivan and Calum I continue to appreciate your support. Calum, I entered the code snippet you provided, and it returns 'file missing'. Looking at this, while the object 'full_filename' exists, what is happening is that the path from getwd() is being appended to the title of the article, but without the '/' between the end of the path name (here 'TEST' and