similar to: Indexing from two variables

Displaying 20 results from an estimated 900 matches similar to: "Indexing from two variables"

2011 Feb 08
1
Just another pattern matching / indexing question
Hi all, thank you for your patience. I am dealing with a large dataset detailing patients and medications Medications are hard to code, as they are (usually) meaningless unless matched with doses. I have a dataframe with vectors (Drug1, Drug2..... Drug 16) and individual patients are represented by rows. The vectors are actually factors, with 100s of possible levels (all the drugs the patient
2012 Jan 01
3
rep() inside of lm()?
HI all, I'm new to R. Say I have a multi-layered list called newlist. ############ > str(newlist) List of 2 $ :List of 5 ..$ : num [1:8088] NA 464 482 535 557 ... ..$ : num [1:8088, 1:2] NA 464 482 535 557 ... ..$ : num [1:8088, 1:3] NA 464 482 535 557 ... ..$ : num [1:8088, 1:4] NA 464 482 535 557 ... ..$ : num [1:8088, 1:5] NA 464 482 535 557 ... $ :List of 3 ..$ : num
2011 Feb 17
1
Populate a list / recursively set list values to NA
Hello all, Maybe I'm being thick, but I was trying to figure out a simple way to create a list with the same dimension of another list, but populated with NA values. masterlist = list( aa=list( a=matrix(rnorm(100),10,10), b=matrix(rnorm(130),13,10), c=matrix(rnorm(140),14,10)), bb=list(
2013 Feb 12
3
grabbing from elements of a list without a loop
Hello! # I have a list with several data frames: mylist<-list(data.frame(a=1:2,b=2:3), data.frame(a=3:4,b=5:6),data.frame(a=7:8,b=9:10)) (mylist) # I want to grab only one specific column from each list element neededcolumns<-c(1,2,0) # number of the column I need from each element of the list # Below, I am doing it using a loop: newlist<-NULL for(i in 1:length(mylist) ) {
2019 Nov 07
5
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
On 10/28/19 1:10 PM, Jason Gunthorpe wrote: ... > include/linux/mmu_notifier.h | 98 +++++++ > mm/Kconfig | 1 + > mm/mmu_notifier.c | 533 +++++++++++++++++++++++++++++++++-- > 3 files changed, 607 insertions(+), 25 deletions(-) > > diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h > index 12bd603d318ce7..51b92ba013ddce
2004 Sep 12
2
boxplot() from list
I have a list containing 48 objects (each with 30 rows and 4 columns, all numeric), and wish to produce 4 boxplot series (with 48 plots in each) , one for each column of each object. Basically I want a boxplot from boxplot(mylist[[]][,i]) for i in 1:4. It seems that I can create a boxplot of length 48 from the entire list, but I don't seem able to subscript to return 4 boxplots from the list
2010 Jun 29
2
how to remove "numeric(0)" component from a list
like this, the list is below, I want to remove the last one . not using newlist[-2], but using the function detect its component is numeric(0) and then remove it from the list. newlist [[1]] [1] 2 3 [[2]] [1] numeric(0) [[3]] [1] 7 [[alternative HTML version deleted]]
2011 Oct 27
0
glmmBUGS fails to accept higher level covariates
Hello I am using glmmBUGS to fit a multilevel model. Treatments are nested in Course are nested in Patients. The predicted variable in total EEG duration. The predictors are: at the observation level : Medication dose at the Course level: Weight in KG and Age at the Patient level: Weight in KG and Age I am trying to fit a multilevel model as in lmer, but in BUGS. Here is an example of the
2011 Jul 01
3
Multilevel Survival Analysis - Cox PH Model
Hello all, thanks for your time and patience. I'm looking for a method in R to analyse the following data: Time to waking after anaesthetic for medical procedures repeated on the same individual. > str(mysurv) labelled [1:740, 1:2] 20 20 15 20 30+ 40+ 50 30 15 10 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr [1:2] "time" "status" -
2015 Mar 24
3
NetCDF
Buenas tardes, pido disculpas si mi consulta es demasiado elemental, pero actualmente encuentro una gran barrera para continuar mi trabajo si no lo solvento. Soy usuaria principiante de R, estoy trabajando con una base de datos climática <https://digital.csic.es/handle/10261/104742>que se encuentra en formato netcdf4 y necesito transformarla a la versión 3 con el fin de visualizarlo en un
2019 Nov 07
2
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
On Wed, Nov 06, 2019 at 09:08:07PM -0500, Jerome Glisse wrote: > > > > Extra credit: IMHO, this clearly deserves to all be in a new mmu_range_notifier.h > > header file, but I know that's extra work. Maybe later as a follow-up patch, > > if anyone has the time. > > The range notifier should get the event too, it would be a waste, i think it is > an oversight
2012 Nov 11
4
Multiplying elements of a list by rows of a matrix
Hi all, I have the following code: set.seed(1) x1 <- matrix(sample(1:12), ncol=3) x2 <- matrix(sample(1:12), ncol=3) x3 <- matrix(sample(1:12), ncol=3) X <- list(x1,x2,x3) tt <- matrix(round(runif(5*4),2), ncol=4) Is there a way I can construct a new list where newlist[[i]] = tt[i,] %*% X[[i]] without using a for loop? Each element of newlist will be 3 x 1 vector. Thanks -- Tina
2019 Nov 08
2
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
On Thu, Nov 07, 2019 at 04:04:08PM -0500, Jerome Glisse wrote: > On Thu, Nov 07, 2019 at 08:11:06PM +0000, Jason Gunthorpe wrote: > > On Wed, Nov 06, 2019 at 09:08:07PM -0500, Jerome Glisse wrote: > > > > > > > > > > Extra credit: IMHO, this clearly deserves to all be in a new mmu_range_notifier.h > > > > header file, but I know that's extra
2011 Aug 24
1
setMethods/setGeneric problem when R CMD CHECK'ing a package
R-helpers: I'm trying to build a package, but I'm a bit new to the whole S3/S4 methods concept. I'm trying to add a new definition of the zoo function "as.yearmon", but I'm getting the following error when it gets to this point during a package install: *** R CMD INSTALL STARStools * installing to library
2019 Oct 28
2
[PATCH v2 13/15] drm/amdgpu: Use mmu_range_insert instead of hmm_mirror
From: Jason Gunthorpe <jgg at mellanox.com> Remove the interval tree in the driver and rely on the tree maintained by the mmu_notifier for delivering mmu_notifier invalidation callbacks. For some reason amdgpu has a very complicated arrangement where it tries to prevent duplicate entries in the interval_tree, this is not necessary, each amdgpu_bo can be its own stand alone entry.
2019 Nov 07
1
[PATCH v2 02/15] mm/mmu_notifier: add an interval tree notifier
On Wed, Nov 06, 2019 at 04:23:21PM -0800, John Hubbard wrote: > Nice design, I love the seq foundation! So far, I'm not able to spot anything > actually wrong with the implementation, sorry about that. Alas :( I feel there must be a bug in here still, but onwards! One of the main sad points was it didn't make sense to use the existing seqlock/seqcount primitives as they have
2009 Jul 19
4
space in column name
I read a table from Microsoft Access using RODBC. Some of the variables had a name with a space in it. R has no problem with it but I do. I cannot find out how to specify the space names(alltime) [1] "ID" "LVL7" "Ref Pv No" "Ref Pv Name" "DOS" "Pt Last Name" "Pt First Name" "MRN"
2019 Nov 01
2
[PATCH v2 14/15] drm/amdgpu: Use mmu_range_notifier instead of hmm_mirror
On Fri, Nov 01, 2019 at 02:44:51PM +0000, Yang, Philip wrote: > > > On 2019-10-29 3:25 p.m., Jason Gunthorpe wrote: > > On Tue, Oct 29, 2019 at 07:22:37PM +0000, Yang, Philip wrote: > >> Hi Jason, > >> > >> I did quick test after merging amd-staging-drm-next with the > >> mmu_notifier branch, which includes this set changes. The test result >
2002 Feb 04
2
Help with accessing elements of a list
Hi, As part of the analysis of a longitudinal study, I have a list, called wg, on R 1.3.1 for windows created as follows - wg <- by(xx, xx$mrn, function(xx) lm(xx$maternal.wt ~ xx$gestation, data=xx)) xx is a data.frame, and so wg contains the results of 293 linear regressions, as lm objects. Now what I want is to extract the 293 intercepts and regression coefficients as a vector, and
2011 Feb 04
3
Importing dates from SPSS file
Hello all, kind regards, I have imported a data.frame from SPSS using "foreign":read.spss but unfortunately it is reading dates in a way neither R nor myself can understand. > book$DATE [1] 13502246400 13443321600 13477795200 13472956800 13501728000 13445395200 13501382400 13502851200 13444185600 13461465600 13457232000 [12] 13458096000 13432435200 13431484800 13495334400