Displaying 19 results from an estimated 19 matches similar to: "choose the lines2"
2013 Jun 04
0
choose the lines2
HI,
You can do this:
dat1<- read.csv("dat7.csv",header=TRUE,stringsAsFactors=FALSE,sep="\t")
dat.bru<- dat1[!is.na(dat1$evnmt_brutal),]
fun2<- function(dat){? 
????? lst1<- split(dat,dat$patient_id)
??? lst2<- lapply(lst1,function(x) x[cumsum(x$evnmt_brutal==0)>0,])
??? lst3<- lapply(lst2,function(x) x[!(all(x$evnmt_brutal==1)|all(x$evnmt_brutal==0)),])
2013 Jun 08
0
data
Hi,
Try this:
final3New<-read.table(file="real_data_cecilia.txt",sep="\t")
dim(final3New)
#[1] 5369??? 5
#Inside the split within split, dummy==1 for the first row.? For lists that have many rows, I selected the row with dummy==0 (from the rest) using the #condition that the absolute difference between the dimensions of those rows and the first row dimension was minimum
2013 May 27
0
choose the lines
Hi,
Try this:
dat1<- read.csv("dat7.csv",header=TRUE,stringsAsFactors=FALSE,sep="\t")
dat.bru<- dat1[!is.na(dat1$evnmt_brutal),]
fun1<- function(dat){??? 
? ??? lst1<- split(dat,dat$patient_id)
??? lst2<- lapply(lst1,function(x) x[cumsum(x$evnmt_brutal==0)>0,])
??? lst3<- lapply(lst2,function(x) x[!(all(x$evnmt_brutal==1)|all(x$evnmt_brutal==0)),])
???
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers
#I have a data panel of thousands of firms, by year and industry and
#one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not
#and another variable the represents the firm dimension (total assets in thousand of euros)
#I need to create two separated samples with the same number os firms where
#one firm in the first have a corresponding
2013 Jun 30
0
Help: argument is not numeric or logical: returning NA
Hi,
One problem with your example dataset is that you have 11 list 
elements with the last one having different dimensions.? I think it was 
based on `summarized`.
Then, the second problem I encountered for testing is that the dataset you provided doesn't fulfill the criteria.
lst1<- list(structure(list......) #output of dput
?
lst2<- lst1[1:10] #deleted the last list element
2013 Apr 12
5
how to change the date into an interval of date?
Hi,
I am not sure I understand your question correctly.
dat1<- read.table(text="
id??????????? responsed_at???????????????? number_of_connection????????????????? scores
1????????????????? 12-01-2010?????????????????????????????????? 1????????????????????????????????????????????? 2
1????????????????? 15-02-2010??????????????????????????????????
2013 May 07
4
how to calculate the mean in a period of time?
Hi,
Your question is still not clear.
May be this helps:
dat2<- read.table(text="
patient_id????? t???????? scores
1????????????????????? 0??????????????? 1.6
1????????????????????? 1??????????????? 2.6
1????????????????????? 2???????????????? 2.2
1????????????????????? 3???????????????? 1.8
2????????????????????? 0????????????????? 2.3
2?????????????????????? 2???????????????? 2.5
2013 May 22
0
calcul of the mean in a period of time
Hi,
I guess you meant this:
dat2<- read.table(text="
patient_id????? t???????? scores
1????????????????????? 0??????????????? 1.6
1????????????????????? 1??????????????? 2.6
1????????????????????? 2???????????????? 2.2
1????????????????????? 3???????????????? 1.8
2????????????????????? 0????????????????? 2.3
2?????????????????????? 2???????????????? 2.5
2?????????????????????
2010 Nov 02
2
multi-level cox ph with time-dependent covariates
Dear all,
I would like to know if it is possible to fit in R a Cox ph model with
time-dependent covariates and to account for hierarchical effects at
the same time. Additionally, I'd like also to know if it would be
possible to perform any feature selection on this model fit.
I have a data set that is composed by multiple marker measurements
(and hundreds of covariates) at different time
2010 Sep 07
2
Plotting longitudinal data
Hello,
Hope that someone could help me plotting longitudinal data below:
7213	3333330001	0.8300	13.05.09	1
1	3333330001	0.8700	09.02.05	NULL
4797	3333330001	0.7700	21.03.07	NULL
2399	3333330001	0.7800	12.04.06	NULL
2400	3333330002	NULL	27.03.06	NULL
7230	3333330002	0.8200	14.05.09	0
2	3333330002	0.8400	09.02.05	NULL
4798	3333330002	0.8700	20.03.07	0
4799	3333330003	0.9000	20.03.07	13
2401
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
2013 May 02
3
R issue with unequal large data frames with multiple columns
I'm a bit of an amateur R programmer.  I can do simple R scenarios but my
handle on complex grammatical issues isn't steady.
I have 12 CSV files that I've read into dataframes.  Each has 8 columns and
over 2000000 rows.  Each dataframe has data associated by time component
and a date component in the format of:
X.DATE and then X.TIME
X.DATE is in the format of MMDDYYYY and X.TIME is
2010 Jun 29
3
merging/intersecting 2 data frames
Dear R People:
I have two data frames, a.df and b.df as seen here:
> a.df[1:10,]
        DATE GENDER PATIENT_ID AGE             SYNDROME
1  4/16/2009      F      23686  45         RASH ON BODY
2  4/16/2009      F      13840  35         CANT URINATE
3  4/16/2009      M      12895  30       BLURRED VISION
4  4/16/2009      M      18375  33       UNABLE TO VOID
5  4/16/2009      M       2237  44
2007 Jun 26
1
A really simple data manipulation example
In response to those who asked for a better explanation of what the
Vilno software does, here's a simple example that gives some idea of
what it does.
LABRESULTS is a dataset with multiple rows per patient , with lab
sodium measurements. It has columns: PATIENT_ID, VISIT_NUM, and
SODIUM.
DEMO is a dataset with one row per patient, with demographic data.
It has columns: PATIENT_ID, GENDER.
2010 Jan 21
2
will_paginate ?
Does anyone have experience with will_paginate?
I''m trying to use it with acts_as_ferret.
routes.rb
...
map.search ''/search'', :controller => ''notes'', :action => ''search''
notes.rb
...
acts_as_ferret :fields => [ ''body'' ]
notes_controller.rb
...
  def search
    if params[ :query ]
      @query = params[
2006 Aug 17
1
How to sort child table on fields in the associated parent
For an Xray file system patients have folders and folders have studies. 
That is:
patients       folders        studies
  id             id             id
  name           patient_id     folder_id
  ...            label          type
                 ...            ...
The list of studies with their associated folder and patient might look 
like this:
name         folder_label       study_type
2007 Sep 13
2
beginner's questions ... sorry
I have 316 files. Each file represents a patient's breathing track
(respiratory signal recorded for a variable number of cycles). All files
have the same are made up of a header followed by a variable number of
records.
Each record contains 7 comma separated fields.
The patient ID is recorder in the header which is stripped off when reading
the file into a R data.frame.
Since I need to keep
2006 Oct 17
2
RODBC and NULL values
Dear All,
Writing sooner than I thought I'd need to.
I'm using R 2.4 on Mac OS X, with RODBC, PostgreSQL 8.1 and Actual's
ODBC driver. I have all my data in Filemaker 8.5, but it is
automatically exported into PostgreSQL for analysis as Filemaker's ODBC
and JDBC access is awful, slow and has a tendency to crash.
I have disability data where for each patient there is a survival
2013 Feb 28
11
new question
Hi,
directory<- "/home/arunksa111/data.new"
#first function
filelist<-function(directory,number,list1){
setwd(directory)
filelist1<-dir(directory)
direct<-dir(directory,pattern = paste("MSMS_",number,"PepInfo.txt",sep=""), full.names = FALSE, recursive = TRUE)
list1<-lapply(direct, function(x) read.table(x,header=TRUE, sep =