similar to: how to select cases based on value of one or more variables

Displaying 20 results from an estimated 10000 matches similar to: "how to select cases based on value of one or more variables"

2005 Apr 02
2
RMySQL question
Dear List, I have this little problem: I work with adiacency matrix like: data me you me 0 1 you 1 0 I store those matrix in a mysql database actually I use RMySQL with: res<-dbSendQuery(connection, "SELECT * FROM table") myDataFrame<-fetch(res) to retrive the table, and I have data me you 1 io 0 1 2 tu 1 0 I would like the first column to be seen
2012 Oct 23
1
factor or character
Hi, The program below work very well. (snps = c('rs621782_G', 'rs8087639_G', 'rs8094221_T', 'rs7227515_A', 'rs537202_C')) Selec = todos[ , colnames(todos) %in% snps] head(Selec) But, I have a data set with 1.000 columns and I need extract 70 to use (like snps in command above). This 70 snps are in a file. So I create a file to extract them with
2003 May 29
5
Comparison Operator
Does R have a comparison operator similar to the Like function, for example: a<-"Is a Fish" b<-"Fish" if(b in a){c<-TRUE} Michael R Howard Micron Technology Inc. Boise ID. Fab C Engineering Software (FCES) Software Engineer
2002 Oct 30
1
RODBC update
There is a new version of RODBC, 0.9-1, with a new maintainer (me) now on CRAN (Vienna) which works with R 1.6.x. The Windows binary will be there tomorrow, and both will then propagate around CRAN. This has been tested on Linux under unixODBC against MySQL and Postgresql (thanks to Dirk Edelbuettel), and on Windows against Access, MySQL and Excel. The CRAN compilation checks were against
2002 Oct 30
1
RODBC update
There is a new version of RODBC, 0.9-1, with a new maintainer (me) now on CRAN (Vienna) which works with R 1.6.x. The Windows binary will be there tomorrow, and both will then propagate around CRAN. This has been tested on Linux under unixODBC against MySQL and Postgresql (thanks to Dirk Edelbuettel), and on Windows against Access, MySQL and Excel. The CRAN compilation checks were against
2007 Jun 16
3
data.frame and subsetting problem
I have read the R online help and wiki and I cannot seem to get something to work the way I need it to. I want to create a new data frame from an subset of an existing data frame which has no reference to the original superset. If you following this example, what I am trying to do may make more sense. I have a file with values like this: shirt,size,40 shirt,color,10 shirt,length,10
2009 Dec 02
4
sort a data frame by a vector
Hi, I have a a vector and a data frame with two columns vec = c("C", "A", "B") dataDF = data.frame(A1 = c("B", "A", "C"), A2 = c(1,2,3)) I would like to sort the data frame by column A1 such that the order of elements in A1 is as the same as in vec. After the ordering, the data frame would be A1 A2 C
2009 Sep 19
3
Replacing values in dataframes
Hi, This is a question of a newbie getting into the exciting world of R. I have several dataframes in the same format as NAD: > NAD[1:3,1:3] Sample.Id Main.abs..1 Main.abs..2 148 10a 0.04836 0.04994 167 11a_1109 0.32245 0.36541 173 11b_1109 0.29293 0.32815 What I want to do is to replace the Sample.Id with a corresponding number.The number
2001 Oct 23
2
Possible bug, Rprof() and scan(pipe()) (PR#1140)
This looks like a bug? Unable to use scan(pipe()) while profiling. I have no idea whether this version of R violates the "do not use `Rprof' in an executable built for profiling" warning in ?Rprof. Thanks -Don > version _ platform powerpc-apple-darwin1.4 arch powerpc os darwin1.4 system powerpc, darwin1.4 status Patched major 1 minor 3.1 year
2013 Feb 01
2
how to setdiff on lists of lists
Dear List, I have a data structure like: > aa [[1]] [1] 1 2 3 [[2]] [1] 4 5 6 > bb [[1]] [1] 3 [[2]] [1] 5 I would like to set differences between "aa" and "bb" and get as result another list of lists like: > res [[1]] [1] 1 2 [[2]] [1] 4 6 I am trying: lapply(aa, setdiff, bb) but I simply get "aa" back as result. Could you please point me in the
2009 Nov 13
1
Utility function to rotate log files?
I am wondering if there is a CRAN package that includes a utility function that will "rotate" file names, in the same sense that operating systems sometimes rotate log files. Or maybe there's something in base R. That is, we have a set of file names, say file1, file2, file3, and when the function is called, file3 is deleted, file2 is renamed file3, file1 is renamed file2, and
2004 Mar 25
3
subsetting based on vector
Dear R users; I am trying to write a small program which reads in a data set, and selects observations from certain years before the analysis. I have a problem including the selection criteria in the header of the program. Here is the problem; dataFIT<-function(MODEL, MARGINS, yearConsidered){ library(foreign CovPaper<-read.spss("C:/Data/data.sav") NewData <-
2011 Jan 03
4
how to invert the axes in the wireframe() plot
Dear List, I am using the wireframe function in the lattice package, and I am wondering if it is possible to invert the default axes orientation for x and y axes... what parameter should I look for? Best regards, Simone Gabbriellini
2005 Aug 24
8
Call SAS from R
Hi All, I am new to post question on this list. I apologize if this question is too easy or irrelevant. I am doing a simulation study and I need to read a data file that can be easily read by SAS. So, what I try to do is to execute SAS in R and then read the output of SAS to R. I try the following code but it didn't work. system("c:\\program files\\sas institute\\v8\\sas.exe
2010 Jan 13
3
Ask for histogram
Hi, I use a vector of data to draw the histogram, but it is different from the graph by SAS. Can you check it for me please? b is a column vector of 4332 hist(b,probability=T,breaks=30,col='lightblue',ylim=c(0,1)) rug(b) When I used rug, I find the records are smaller than 4332. I don't know where I did wrong. Thanks. -- Yi Du [[alternative HTML version deleted]]
2008 Aug 02
1
running strucchange?
Greetings, I'm complety new to "R" and have a question. I've read through a couple of manuals but I'm having a problem with getting something run properly. I'd like to attempt to use the "strucchange" package with some sample data however I'm having trouble understanding the proper syntax of the commands from which to do so. I basically want to take
2009 Nov 20
1
rounding the time: significant 0 does not appear (PR#14074)
Full_Name: Gustavo Lacerda Version: 2.9.1 OS: Windows Submission from: (NULL) (137.82.157.97) I obtained 'time' by subtracting the results of two calls to sys.Time(). > round(time,0) Time difference of 1 mins > round(time,1) Time difference of 1 mins > round(time,2) Time difference of 1.03 mins > round(time,3) Time difference of 1.032 mins Note that the second command
2008 May 14
1
howto get significant digits for round()
i have a table like this of an value and its tolerance length delta-length 12.2232 0.4 123.422 0.034123 1234 12 i want to round the value to the significant digits in this way: my-round(length,delta-length) 12.2 , 0.4 123.42 , 0.03 1234 , 12 how can i do this with R? please CC to email, thanks so far, -- Jonas Stein <news at jonasstein.de>
2009 May 05
1
RMySQL insert statements?
Heya Folks, I can not find anything on executing insert statement through RMySQL, can someone please enlighten me? All i've found so far on getting data into a database is the write table functionality. Reading all data into memory appending additional information and writing that into a table is fine on my test environment, but won't be possible on the production environment because of
2009 Oct 28
1
Help - Probability scale on an ECDF plot
Hello; Can anyone tell me how to set my y-axis to a probability scale on an ECDF plot? Or alternatively, how to generate a plot of percent cumulative probability against concentration? DASplusR does this and calls it a CP plot, but I would like to be able to generate this outside of DASplusR- Thank you! [[alternative HTML version deleted]]