similar to: subsetting by cell value with a list

Displaying 20 results from an estimated 20000 matches similar to: "subsetting by cell value with a list"

2017 Sep 28
3
Boxplot, formula interface, and labels.
I have data I'd like to plot using the formula interface to boxplot. I call boxplot like so: with(mydata, boxplot(count ~ geno * tissue)) I get a boxplot with x axis labels like "wt.kidney". I would like to change the '.' to a newline. Where is this separator configured? Thanks, -Ed
2017 Nov 02
3
ggplot inside function doesn't plot
I don't really understand. I mean, I understand the solution is print(ggplot(...)). But why is that required in a function and not at the console? Shouldn't I be able to rely on what I do at the console working in a script? Is this inconsistent behavior by design? On Thu, Nov 2, 2017 at 11:54 AM, David Winsemius <dwinsemius at comcast.net> wrote: > >> On Nov 2, 2017,
2017 Sep 28
0
Boxplot, formula interface, and labels.
mybp <- boxplot(count ~ geno * tissue, data = mydata, plot = FALSE) mybp$names <- gsub("\\.", "\n", mybp$names) bxp(mybp) See ?boxplot for details. Best, Ista On Thu, Sep 28, 2017 at 12:40 PM, Ed Siefker <ebs15242 at gmail.com> wrote: > I have data I'd like to plot using the formula interface to boxplot. > I call boxplot like so: > > with(mydata,
2017 Sep 28
1
Boxplot, formula interface, and labels.
Just change the separator: data(Titanic) Titanic.df <- as.data.frame(Titanic) boxplot(Freq~Class*Sex, Titanic.df, cex.axis=.6, sep="\n") See attached .png. ---------------------------------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77843-4352 -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On
2017 Oct 24
2
as.data.frame doesn't set col.names
Why doesn't this work? > samples$geno <- as.data.frame(sapply(yo, toupper), col.names="geno") > samples quant_samples age sapply(yo, toupper) E11.5 F20het BA40 E11.5 F20het BA40 E11.5 F20HET E11.5 F20het BA45 E11.5 F20het BA45 E11.5 F20HET
2018 May 18
3
Exporting to text files
I have dose response data analyzed with the package 'drc'. 'summary(mymodel)' prints my kinetic parameters. I want that text in an ASCII text file. I want to get exactly what I would get if I copied and pasted from the terminal window. I've read the documentation on data export to text files here:
2012 Mar 28
2
lapply and paste
I have a list of suffixes I want to turn into file names with extensions. suff<- c("C1", "C2", "C3") paste("filename_", suff[[1]], ".ext", sep="") [1] "filename_C1.ext" How do I use lapply() on that call to paste()? What's the right way to do this: filenames <- lapply(suff, paste, ...) ? Can I have lapply()
2012 Feb 29
3
Broken R
Hi, I am running Debian Sid. I am having trouble with the R packages. Executing 'help()' or 'demo()' launches 'most' with no text. 'help.start()' works properly. When I try to install a package, I get the following problem: ********************************************************************* > install.packages("ctv") Installing package(s) into
2017 Oct 24
0
as.data.frame doesn't set col.names
Wait. Now I'm really confused. > > head(samples) quant_samples age sapply(yo, toupper) E11.5 F20het BA40 E11.5 F20het BA40 E11.5 F20HET E11.5 F20het BA45 E11.5 F20het BA45 E11.5 F20HET E11.5 F20het BB84 E11.5 F20het BB84 E11.5 F20HET E11.5 F9.20DKO KTr3 E11.5 F9.20DKO KTr3 E11.5 F9.20DKO E11.5
2009 Oct 19
1
updating columns using other column as reference
Dear R-gurus, Just supose I have a dara.frame that looks like myDF<-read.table(stdin(),head=T,sep=",") codID,namesp,k1,k2,k3,k4 1,spA,2,5,6,3 2,spB,4,5,4,6 3,spC,2,1,5,6 4,spC,5,4,3,2 5,spD,1,2,3,4 6,spE,2,4,3,1 I need to update the columns k1-k4 with the namesp, but considering the math between Kx and codID. My desired output must looks like: codID,namesp,k1,k2,k3,k4
2012 Mar 24
3
argument names inside a function?
Is there a way I can get the names of the arguments passed to a function from within a function?
2017 Oct 23
2
A list of data frames and a list of colnames.
I have a list of file names, and a list of data frames contained in those files. mynames <- list.files() mydata <- lapply(mynames, read.delim) Every file contains two columns. > colnames(mydata[[1]]) [1] "Name" "NumReads" > colnames(mydata[[2]]) [1] "Name" "NumReads" I can set the colnames easily enough with a for loop. for (i in
2016 Apr 18
2
lists and rownames
I'm doing some string manipulation on a vector of file names, and noticed something curious. When I strsplit the vector, I get a list of character vectors. The list is numbered, as lists are. When I cast that list as a data frame with 'as.data.frame()', the resulting columns have names derived from the original filenames. Example code is below. My question is, where are these names
2009 Jan 20
5
Problem with subset() function?
Hi all, Can anyone explain why the following use of the subset() function produces a different outcome than the use of the "[" extractor? The subset() function as used in density(subset(mydf, ht >= 150.0 & wt <= 150.0, select = c(age))) appears to me from documentation to be equivalent to density(mydf[mydf$ht >= 150.0 & mydf$wt <= 150.0, "age"])
2017 Nov 02
3
ggplot inside function doesn't plot
I have a function: myplot <- function (X) { d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) png(paste("img/", X, ".png", sep="")) ggplot(d, aes(x=condition, y=count, color=condition)) + geom_point(position=position_jitter(w=0.1,h=0)) + scale_y_log10(breaks=c(25,100,400)) + ggtitle(X) +
2018 May 18
0
Exporting to text files
?sink On May 18, 2018 9:47:25 AM PDT, Ed Siefker <ebs15242 at gmail.com> wrote: >I have dose response data analyzed with the package 'drc'. >'summary(mymodel)' prints my kinetic parameters. I want >that text in an ASCII text file. I want to get exactly what I >would get if I copied and pasted from the terminal window. > >I've read the documentation on
2017 Nov 02
0
ggplot inside function doesn't plot
> On Nov 2, 2017, at 9:27 AM, Ed Siefker <ebs15242 at gmail.com> wrote: > > I have a function: > > myplot <- function (X) { > d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) > png(paste("img/", X, ".png", sep="")) > ggplot(d, aes(x=condition, y=count, color=condition)) + >
2017 Sep 25
2
Subset
myDF <- data.frame(a = c("<0.1", NA, 0.3, 5, "Nil"), b = c("<0.1", 1, 0.3, 5, "Nil"), stringsAsFactors = FALSE) # you can subset the b-column in several ways myDF[ , 2] myDF[ , "b"] myDF$b # using the column, you make a logical vector ! is.na(as.numeric(myDF$b)) # This can be used to select the
2017 Sep 25
1
Subset
Always via logical expressions. In this case you can use the logical expression myDF$b != "0" to give you a vector of TRUE/FALSE B. > On Sep 25, 2017, at 8:00 AM, Shane Carey <careyshan at gmail.com> wrote: > > This is super, really helpfull. Sorry, one final question, lets say I wanted to remove 0's rather than NAs , what would it be? > > Thanks >
2017 Sep 25
0
Subset
This is super, really helpfull. Sorry, one final question, lets say I wanted to remove 0's rather than NAs , what would it be? Thanks On Mon, Sep 25, 2017 at 12:41 PM, Boris Steipe <boris.steipe at utoronto.ca> wrote: > myDF <- data.frame(a = c("<0.1", NA, 0.3, 5, "Nil"), > b = c("<0.1", 1, 0.3, 5, "Nil"), >