similar to: Subset based on items in a list.

Displaying 20 results from an estimated 600 matches similar to: "Subset based on items in a list."

2012 Apr 27
1
Wrap names.arg text in barplot
Hello! Does anyone know of a handy way to wrap the names.arg text in a barplot? I'm creating a bar plot with rather long labels; I can adjust the margins, but I'd also like to have the text wrap to about 4cm. Thanks! Kyle H. Ambert Doctoral Candidate, Bioinformatics Oregon Health & Science University ambertk@gmail.com [[alternative HTML version deleted]]
2007 Mar 26
1
data-frame adding/deleting column
Hallo, I have got an existing data frame and want to add a new column. The existing data frame was created like this: > df <- rbind( c("Fred", "Mary", 4), c("Fred", "Mary", 7), + c("Fred", "Mary", 9), c("Barney", "Liz", 3), + c("Barney", "Liz", 5) ) > df
2011 Mar 15
3
create data set from selection of rows
Readers, For a data set: text1,23,text2,45 text1,23,text3,78 text1,23,text3,56 text1,23,text2,45 The following command was entered: datasubset<-data.frame(dataset[,3]=="text3") The result of datasubset is TRUE TRUE The required result is text1,23,text3,78 text1,23,text3,56 What is the correct command to use please? Thanks in advance.
2007 Aug 03
3
question about logistic models (AIC)
Een ingesloten tekst met niet-gespecificeerde tekenset is van het bericht gescrubt ... Naam: niet beschikbaar Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070803/79b6292b/attachment.pl
2007 Dec 12
2
possible bug in eager loading
Hello, @users = User.find(:all, :include => {:user_data => :user_data_field}, :order => "username = ''someone-oHC15RC7JGTNLxjTenLetw@public.gmane.org'' desc", :limit => 50) This produces: User Load IDs For Limited Eager Loading (74.648762) SELECT * FROM (SELECT DISTINCT ON (users.id) users.id, username AS alias_0 FROM users LEFT OUTER JOIN
2007 May 18
3
{10,20,30}>={25,30,15}
Hi There, Using t.test to test hypothesis about which one is greater, A or B? where A={10,20,30},B={25,30,15}. My question is which of the following conclusions is right? #################hypothesis testing 1 h0: A greater than or equal to B h1: A less than B below is splus code A=c(10,20,30) B=c(25,30,15) t.test(c(10,20,30),c(25,30,15),alternative="less") output: p-value=0.3359
2007 Mar 26
0
Sphericity and post-hoc analysis in a repeated-measure ANOVA
Does anyone have any suggestions for how to test for violation of the sphericity assumption and apply the Huynh-Feldt correction to a repeated-measure model? My model follows the format below: Rep.anova=aov(Y~X1*X2+Error(Subject/(X1*X2),data=DataFile)) I've already looked at the explanations aov() and Error() in Baron's “Notes on the use of R for psychology experiments and
2007 Jul 31
5
extract columns of a matrix/data frame
Hello all, I have a matrix whose column names look like a1 a2 b1 b2 b3 c1 c2 1 2 3 7 1 3 2 4 6 7 8 1 4 3 Now, I can have any number of a's. not just two as shown above and same goes for b's and c's. I need to extract all the a's columns and put them in another matrix, extract all b's columns and put them in some matrix
2007 Apr 09
1
Repeated Measures design using lme
Hi, I have what I believe is a repeated-measures dataset that I'm trying to analyze using lme(). This is *not* homework, but an exercise in my trying to self-teach myself repeated-measure ANOVA for other *real* datasets that I have and that are extremely similar to the following design. I'm fairly sure the dataset described below would work with lme() -- but it'd be great if anybody
2011 Jun 15
1
Print the summary of a model to file
Hi there, I am having a strange problem. I am running nls on some data. #data x <- -(1:100)/10 y <- 100 + 10 * (exp(-x / 2) Using nls I fit an exponential model to this data and get a great fit summary(fit) Formula: wcorr ~ (Y0 + a * exp(m1 * -dist/100)) Parameters: Estimate Std. Error t value Pr(>|t|) Y0 -0.0001821 0.0002886 -0.631 0.528 a 0.1669675 0.0015223
2007 Jul 31
2
choosing between Poisson regression models: no interactions vs. interactions
R gurus, I'm working on data analysis for a small project. My response variable is total vines per tree (median = 0, mean = 1.65, min = 0, max = 24). My predictors are two categorical variables (four sites and four species) and one continuous (tree diameter at breast height (DBH)). The main question I'm attempting to answer is whether or not the species identity of a tree has
2007 May 21
3
quartz() on MAC OSX
I am (desperately) trying to get used to using a Mac here at my new location. (Why *anyone* would ever use anything other than Linux, except under duress as I am, totally escapes me, but that's another story.) Fortunately much of the Mac OSX is actually Unix, so a civilized person can manage to carry on ... But there are some things. (Like this <expletive deleted> mailer ... But
2011 Feb 17
1
Select distinict on not chainable with order method
Hi. I would like to do code refactoring: @beers = [] Beer.all.each do |beer| unless @beers.find{|c| c.brand_id == beer.brand_id} @beers << beer end break if @beers.size > 29 end So I achieved this by writing scope (on PostgreSQL): scope :with_unique_brand, select("DISTINCT ON (beers.brand_id) beers.*") Using this scope alone is working
2012 Mar 15
2
ggplot2: goem_smooth and suppress messages
Hi When I run my script using ggplot and geom_smooth I get messages that I would like to suppress: p <- ggplot(dataSubset) p <- p + aes(x = as.Date(factor(key),format="%Y%m%d")) + geom_line() p <- p + geom_smooth(span=0.2,se=FALSE,size=0.7) The messages look like this: geom_smooth: method="auto" and size of largest group is <1000, so using loess. Use 'method
2011 Sep 08
2
help subsetting data based on date AND time
Dear R Community, I am new to R, and have a question that I suspect may be quite simple but is proving a formidable roadblock for me. I have a large data set that includes water-quality measurements collected over many 24-hour periods. The date and time of sample collection are in a combined Date/Time field in the format yyyy-mm-dd hh:mm:ss. I need to be able to subset the data for analysis of
2007 Oct 23
2
Plot a line according to a specified equation
Does anyone know how to graph a line according to a specified equation? I'd like to plot the following hyperbola: Y=139.35/(1+(0.174*X)) I know there's a way to do this, but I'm having a ridiculous time trying to remember how. Thanks! Kyle H. Ambert Department of Behavioral Neuroscience Oregon Health & Science University [[alternative HTML version deleted]]
2008 Dec 05
6
Running R Script on a Sequence of Files
Hi, I have about 900 files that I need to run the same R script on. I looked over the R Data Import/Export Manual and couldn't come up with a way to read in a sequence of files. The files all have unique names and are in the same directory. What I want to do is: 1) Create a list of the file names in the directory (this is really what I need help with) 2) For each item in the
2011 Mar 23
4
Modifying a particular column in a tab-delimited file
Hello R users, Good day!! I was wondering if there is a way in R to read in a particular column from a tab-delimited file, edit it and write it back into the file with all other columns intact. When I say edit I mean just replacing all the values in that column. I know to read a particular column from a file using colClasses option in read.delim() function. Is there any such option to write out
2005 Feb 22
4
round() - strange results
Hello, I found that round() does not behave as I expected. Have you had similar experience as following? > x<-seq(0.5,10.5,by=1) > x [1] 0.5 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 10.5 > round(x) [1] 0 2 2 4 4 6 6 8 8 10 10 > cbind(x,round(x)) x [1,] 0.5 0 [2,] 1.5 2 [3,] 2.5 2 [4,] 3.5 4 [5,] 4.5 4 [6,] 5.5 6 [7,] 6.5 6
2010 Nov 29
3
how to use by() ?
Hello, All! How might one accomplish this using the by() function? m1 is a data frame. # populate column "m1$major_allele" for ( i in 1:length(m1$major_allele)) { if ( m1$Freq1[i] == m1$MAF[i]){ m1$major_allele[i] = m1$Al1[i] } else{ m1$major_allele[i] = m1$Al2[i] } } Jim [[alternative HTML version deleted]]