similar to: Retrieving Factors with Levels Ordered

Displaying 20 results from an estimated 5000 matches similar to: "Retrieving Factors with Levels Ordered"

2009 Sep 16
3
apply function across two variables by mult factors
Greetings, I am attempting to run a function, which produces a vector and requires two input variables, across two nested factor levels. I can do this using by(X, list(factor1, factor2), function), however I haven't found a simple way to extract the list output into an organized vector form. I can do this using nested loops but it isn't exactly an optimal approach. Thank you
2009 Mar 20
4
how to make aggregation in R ?
Hi, I am trying to aggregate the sum of my test data.frame as follow: testDF <- data.frame(v1 = c("a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "c", "c", "c", "c", "c", "d", "d", "d", "d",
2011 Mar 09
2
SQLDF - Submitting Queries with R Objects as Columns
Fellow R programmers, I'd like to submit SQLDF statements with R objects as column names. For example, I want to assign "X" to "var1" (var1<-"X") and then refer to "var1" in the SQLDF statement. SQLDF needs to understand that when I reference "var1", it should look for "X" in the dataframe. This is necessary because my SQLDF
2008 Feb 26
1
wrapper for save function
Hello - I would like to create a wrapper to the 'save' function in the base package, but have a small problem with the name of the object that is getting saved in the file. Below is a simple example illustrating my problem. ## BEGIN SAMPLE R CODE ################################################## ## Here is the wrapper for the save function
2007 Nov 09
2
wrapper for coxph with a subset argument
Dear R-help - Thanks to those who replied yesterday (Christos H. and Thomas L.) regarding my question on coxph and model formula, the answers worked perfectly. My new question involves the following. I want to run several coxph models (package survival) with the same dataset, but different subsets of that dataset. I have found a way to do this, described below in functions subwrap1 and
2009 Jun 22
1
Problem with storing a sequence of lmer() model fit into a list
Dear R-helpers: May I ask a question related to storing a number of lmer model fit into a list. Basically, I have a for-loop (see towards the bottom of this email) in the loop, I am very sure that the i-th model fit (i.e.,fit_i) is successfully generated and the character string (i.e., tmp_i) is created correctly. The problem stems from the following line in the for-loop #trouble making line
2007 Dec 19
1
Different labels by panel in barchart
Dear all, I'm analysing a survey, and creating a barchart of the different responses for each question. The questions are grouped according to a number of categories, so I'm using lattice to create a plot with each question in a category on it. The problem is that the response set for different questions within the same category varies. I want to be able to draw only the relevant
2009 Feb 20
2
Grouped bwplots?
Dear list, I am sorry for asking you this, but I am trying to do again what I thought I have done before, although this time it does not work. So, given the data set: > testdf <- data.frame(grfak=sample(c("One","Two"),size=100,replace=TRUE), panfak= sample(c("Yes","No"),size=100,replace=TRUE), xfak=
2011 May 17
1
Dealing with null values Aggregate function
Hi R users I trying to some aggregate statistics on a very large dataset. The null values are causing a problem. I would like to calculate aggregate values for groups. I am just no sure how to deal with the "" I would ideally like them to ignored ie if there is only 1 value over several columns than that value would be the summary statistic. I have put the following example together to
2008 Apr 03
1
by "infelicity"
Dear list, Please find below an example of odd behaviour of the by function. It occurs both under GNU/Linux R 2.6.2 and Windows R 2.7.0alpha. Respective sessionInfo()'s are given below. I hope I do not overlook anything. testFactor <- factor(sample(LETTERS[1:6], size = 42, replace = TRUE)) testMatrix <- matrix(rnorm(42 * 6), nrow = 42) testDf <- as.data.frame(testMatrix) by(data
2010 Dec 05
6
wintricks error
htr at htr:~$ winetricks directx9 Executing wget -O directx_feb2010_redist.exe -nd -c --read-timeout=300 --retry-connrefused --header Accept-Encoding: gzip,deflate http://download.microsoft.com/download/E/E/1/EE17FF74-6C45-4575-9CF4-7FC2597ACD18/directx_feb2010_redist.exe directx_feb2010_redist.exe: Access denied ------------------------------------------------------ Note: command 'wget -O
2013 Oct 07
1
Why read.table replacing space with "." in the header
Hi, Use `check.names=FALSE` head(dd,2) #? Phylo.Tree Genesis.Tree #1????????? 1??????????? 2 #2????????? 2??????????? 3 ?dd <- data.frame("Phylo Tree"= c(1:10), "Genesis Tree"= c(2:11),check.names=FALSE) head(dd,2) #? Phylo Tree Genesis Tree #1????????? 1??????????? 2 #2????????? 2??????????? 3 write.csv(dd,"Crish.csv",row.names=FALSE) ?yy<-
2006 Mar 29
1
calcualtign a trailing 12 column mean in a dataframe?
I have a dataframe of 25 columns and 100,000 rows called ?testdf?. I wish to build a new dataframe, with 14 columns and 100,000 rows. I wish the new dataframe to have the ?trailing 12 column? mean. That is, I want column 1 of the new dataframe to have soemthing like: ?( mean(testdf[,1:12],na.rm=T)? What is the best way to accomplish this?
2011 Jul 01
4
Access only part of last dimension of table/matrix
I would like to do some operations inside a function using only one value for the last dimension of a table/matrix: tabfn <- function (dfrm, facvec, YN ="event"){ return( Etbl <- do.call(table, dfrm[ , c(facvec, "event") ]) ) # just want Etbl[,,,"TRUE"] or Etbl[,, "TRUE"] or Etbl[,"TRUE"] }
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
> diff --git a/hw/virtio/virtio-pstore.c b/hw/virtio/virtio-pstore.c > new file mode 100644 > index 0000000..b8fb4be > --- /dev/null > +++ b/hw/virtio/virtio-pstore.c > @@ -0,0 +1,699 @@ > +/* > + * Virtio Pstore Device > + * > + * Copyright (C) 2016 LG Electronics > + * > + * Authors: > + * Namhyung Kim <namhyung at gmail.com> > + * > + * This
2016 Aug 24
2
[PATCH 2/3] qemu: Implement virtio-pstore device
> diff --git a/hw/virtio/virtio-pstore.c b/hw/virtio/virtio-pstore.c > new file mode 100644 > index 0000000..b8fb4be > --- /dev/null > +++ b/hw/virtio/virtio-pstore.c > @@ -0,0 +1,699 @@ > +/* > + * Virtio Pstore Device > + * > + * Copyright (C) 2016 LG Electronics > + * > + * Authors: > + * Namhyung Kim <namhyung at gmail.com> > + * > + * This
2012 Mar 25
2
string substitution for argument in function
hello, I want to iterate through a list of names and use each element as an argument in a function. For instance: > a = c('one','two','three') > data= c() > for(elem in a){data=cbind(elem = 2,data)} > data elem elem elem [1,] 2 2 2 instead I want 'elem' to be substituted by the string in the list. Doing it by hand would be: > data =
2016 Jul 19
2
[PATCH 2/3] qemu: Implement virtio-pstore device
Hello, On Mon, Jul 18, 2016 at 11:03:53AM +0100, Stefan Hajnoczi wrote: > On Mon, Jul 18, 2016 at 01:37:40PM +0900, Namhyung Kim wrote: > > +static void virtio_pstore_handle_io(VirtIODevice *vdev, VirtQueue *vq) > > +{ > > + VirtIOPstore *s = VIRTIO_PSTORE(vdev); > > + VirtQueueElement *elem; > > + struct virtio_pstore_hdr *hdr; > > + ssize_t
2016 Jul 19
2
[PATCH 2/3] qemu: Implement virtio-pstore device
Hello, On Mon, Jul 18, 2016 at 11:03:53AM +0100, Stefan Hajnoczi wrote: > On Mon, Jul 18, 2016 at 01:37:40PM +0900, Namhyung Kim wrote: > > +static void virtio_pstore_handle_io(VirtIODevice *vdev, VirtQueue *vq) > > +{ > > + VirtIOPstore *s = VIRTIO_PSTORE(vdev); > > + VirtQueueElement *elem; > > + struct virtio_pstore_hdr *hdr; > > + ssize_t
2006 Mar 17
1
Autocompleter.Local problem/desparate plea for help...
I have been trying to write a selector function for Autocompleter.Local that will show a predefined Array and will scroll automatically to the first match. I have had success with with getting my list to populate and show all of the choices, however I cannot get it to scroll to the first match. Since I build the JS Array I can know exactly how many items are in the list going into my selector,