similar to: How can I write routines and scripts in the R environment ?

Displaying 20 results from an estimated 400 matches similar to: "How can I write routines and scripts in the R environment ?"

2011 Nov 16
1
Splitting row in function of time
Hello all, I have a data frame that looks like this: http://r.789695.n4.nabble.com/file/n4077622/Capture.png I would like to know if it's possible to split a single row into two rows when the time frame between "beg" and "end" overlaps midnight. I want to compare the frequency of each activity for each day so a row for a phase that overlaps on two dates unbalances the
2011 Nov 02
2
Creating barplot using time as X
Hello all, my data looks like this: "phaseno" / "activity" / "beg" / "end" / "phasetime" 1 / "L" / 2010-06-03 19:15:24 / 2010-06-03 21:18:14 / 7370 2 / "D" / 2010-06-03 21:18:15 / 2010-06-03 21:19:55 / 100 3 / "W" / 2010-06-03 21:19:56 / 2010-06-03 21:22:47 / 171 4 / "D" / 2010-06-03 21:22:48 / 2010-06-03
2007 Dec 12
2
discrepancy between periodogram implementations ? per and spec.pgram
hello, I have been using the per function in package longmemo to obtain a simple raw periodogram. I am considering to switch to the function spec.pgram since I want to be able to do tapering. To compare both I used spec.pgram with the options as suggested in the documentation of per {longmemo} to make them correspond. Now I have found on a variety of examples that there is a shift between
2008 Jun 05
0
two questions about regression models and clustering routines
I managed to use an example (see attachment) of clever regression routines. I customized it to suit my needs. The initial model I try to fit consists of the first 10 powers of time (time the observation was recorded) and the first 10 powers of the phase. In fact my files record patients' breathing signals as a sequence of breathing cycles. Every cycle sampled phase (inhale - exhale) is mapped
2005 May 04
1
lmer error:flist must be a non-empty list
Hi, I was wondering if anyone could give me advice regarding using the lmer command in lme4 package to do logistic regression (mixed effects model). I use the following command lmer(ISH ~ArrayPathology2, random=~1|PatientID, data=HSDB4.noNA, family="binomial") where ISH is outcome(0 or 1), ArrayPathology2 is the variable of interest(factor), PatientID is random effect(factor), and
2005 Oct 01
3
dec2bin?
Hello, I just want to ask if there is any function that can convert decimal number to binary vector. Thanks a lot. Haiyong
2017 Aug 19
2
Update data in text file with data in dataframe
Hello all, I'm a novice R programmer and I don't have a clue as to how to approach this. I have tried many different approaches only to fail and I can't seem to wrap my head around it. So I turn to the experts. I have a text file with patient data that has incorrect dates of service. I need to update the dates of service in the text file with data that's in a dataframe.
2018 Mar 22
3
How do I include a factor in a groupedData object? Meaning and use of inner and outer parameters
Windows 10 64-bit, R-Studio, R version 3.4.3 Several questions relating to groupedData: (1) I am trying to create a groupedData object that can be used to run an analysis that I have been able to urn using lmer. When I include the interaction terms in the groupedData opbject I get an error message stating that + is not meaningful for factors. How do I include factors in my model? See code and
2017 Aug 19
0
Update data in text file with data in dataframe
You might get someone on this last willing to invent something from scratch, but really this mailing list works best if you give very specific information, such as a verbatim copy of several records worth of your data file including all the stuff you want to skip over. Usually if someone is planning on inventing an example from scratch they make a blog post which you could find via search engine.
2017 Aug 19
1
Update data in text file with data in dataframe
I think we need a bit more info on the data layout and what decision rule you are using to update the Date of Service. Are you just updating a record to provide the most recent DoS or are you correcting errors? Have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example or Reproducibility ? Advanced R.for some susggestions on how to form a good question
2007 Mar 27
1
basic handling of data.frame
Hello, I'm new to R but wan't to use it to compute the statistics of my medical study. The study includes several parameters for a number of patients. Each parameter was assessed by a number of readers, once with a special condition, once without. Now I have a data.frame with colums like: PatientID, ReaderID, SpecialCond(yes/no), Parameter1, Parameter2..... the rows are not sorted, and
2018 Mar 22
0
How do I include a factor in a groupedData object? Meaning and use of inner and outer parameters
Dear John You are only allowed to have the primary covariate on the left hand side of the vertical bar. Other covariates go in inner or outer. Michael On 22/03/2018 12:59, Sorkin, John wrote: > Windows 10 64-bit, R-Studio, R version 3.4.3 > > > Several questions relating to groupedData: > > (1) I am trying to create a groupedData object that can be used to run an analysis
2006 Mar 09
0
Need help on Coxph
Hi all, I have a dataset which includes 84 rows and 4313 columns. Starting from the 2nd row, each row represents a patient. The 1st column is for "arrayID" 2nd column is for "time" 3rd column is for "cancer" 4th column is for "patientID" Starting for the 5th columns, each
2010 Feb 23
1
How to change a venn command into a named object that can be plotted like a lattice object
Hello, I am plotting data as a venn diagram but would like to be able to control how it is plotted like a lattice object. Right now, it plots right away. I would like to name it and then plot at will. I thought to convert the whole thing to a PostScript file then get it back into R via grImport, but surely (please!) there must be a less roundabout way to do this. Any help is appreciated. Here
2010 Jun 18
2
help with reshape is needed again!
hi, folks: i need to transpose the following data: gene tissue patient1 patient2 patient3..... --------------------------------------------- gene1 breast 10 100 1 gene2 breast 20 200 4 gene3 breast 30 50 5 gene4 breast 40 400 9 ................................ to the
2007 Oct 02
4
R routines vs. MATLAB/SPSS Routines
Hi all, I've become quite enamored of R lately, and have decided to try to teach some of its basics (reading in data, manipulation and classical stats analyses) to my fellow grad students at the University of Toronto. I sent out a mass email and have already received some positive responses. One student, however, wanted to know what differentiates the routines that R uses, from those
2010 Jun 17
2
help for reshape function
hi, everyone: i have a question on the reshape function. i have the following dataset : gene tissue patient1 patient2 patient3............. _________________________________________________ gene1 breast 10 20 50 gene2 breast 20 40 60 gene3 breast 100 200 300 which i hope to convert to the following format: gene patientID
2009 Dec 10
1
Need help creating multiple datasets using loops or vectorization
I am trying to create multiple dataset by group like the following using either a loop or vectorization: vocallGp1<-subset(vocallsub, Group==1) vocallGp2<-subset(vocallsub, Group==2) vocallGp3<-subset(vocallsub, Group==3) vocallGp4<-subset(vocallsub, Group==4) vocallGp5<-subset(vocallsub, Group==5) When I create the loop I get the following error:
2007 Jun 08
1
Location of xgraphics routines
Hi I have an application that uses the Xwindows graphics library. Things like XOpenDisplay XDrawLine XCreateSimpleWindow XDrawString and many more Under all the CENTOS 4.X systems these were automatically loaded. I dont have these loaded under my CENTOS 5 system. I get a heap of undefined references when I compile the code. Could someone tell me, point me, where these routines now reside on
2007 Aug 20
1
Common routines for custom functions
Hello I want to share some common subroutines between my custom functions. Given the way Puppet loads the .rb files in $plugindest/puppet/parser/functions, does anyone know how should I lay this out? I tried creating a module myutilities def self.blah() ... end end (NOT within the newfunction() call) in one of the (top-level) functions'' .rb file. However, calling