similar to: Delete row if two values in a matrix are equal

Displaying 20 results from an estimated 300 matches similar to: "Delete row if two values in a matrix are equal"

2012 Oct 14
6
transforming a .csv file column names as per a particular column rows using R code
Hello all, I have a .csv file like below. Tool,Step_Number,Data1,Data2... etc up to 100 columns. A,1,0,1 A,2,3,1 A,3,2,1 . . B,1,3,2 B,2,1,2 B,3,3,2 . . ...... so on upto 50 rows where the column "*Tool*" has distinct steps in second column "*Step_Number*",but both have same entries in Step_Number column. I want the output like below.
2012 Sep 01
5
R_closest date
Hi, I have encountered an issue about finding a date closest to another date So this is how the data frame looks like: PT_ID IDX_DT OBS_DATE DAYS_DIFF OBS_VALUE CATEGORY 13 4549 2002-08-21 2002-08-20 -1 183 2 14 4549 2002-08-21 2002-11-14 85 91 1 15 4549 2002-08-21 2003-02-18 181 89 1 16 4549 2002-08-21 2003-05-15
2012 Jul 24
5
First value in a row
Hi. This is likely a trivial problem but have not found a solution. Imagine the following dataframe: Lat Lon x1 x2 x3 01 10 NA NA .1 01 11 NA .2 .3 01 12 .4 .5 .6 I want to generate another column that consist of the first value in each row from columns x1 to x3. That is NewColumn .1 .2 .4 Any input greatly appreciated, Thanks, Camilo Camilo Mora, Ph.D.
2012 Mar 10
3
function input as variable name (deparse/quote/paste) ??
Hi all Say I have a function: myname=function(dat,x=5,y=6){ res<<-x+y-dat } for various input such as myname(dat1) myname(dat2) myname(dat3) myname(dat4) myname(dat5) how should I modify the 'res' line, to have new informative variable name correspondingly, such as dat1.res dat2.res dat3.res dat4.res dat5.res stored in the workspace. This is only an example of a complex
2012 Jul 29
1
readRDS, In as.double.xts(fishReport$count) : NAs introduced by coercion
Hello, I looked in the R-help but could not find an archive addressing the following. I would like to convert a character to numeric after reading a file with RDS extension. After using as.numeric, I checked if it is numeric. It was not converted. Please help. Here is my code >Report <- readRDS(file="RDS/Report.RDS") > Report[1:2,] dive_id date
2011 Jul 02
5
How many times occurs
Hi all, I have a data matrix likein "input.txt" 8 9 2 5 4 5 8 5 6 6 8 9 2 8 9 2 8 9 2 1 8 9 2 5 4 5 8 5 6 4 8 9 2 5 4 5 8 5 6 6 8 9 2 8 9 2 8 9 2 1 8 9 2 5 4 5 8 9 2 2 In this example will be an 6x10 matrix (or data frame) I want to detect how many times in a row appears this combination 8 follewd by 9 followed by 2, and create a new matrix with only this number of occurs then
2010 Nov 16
1
AOV/LME
Hi everyone, I'm having a little trouble with working out what formula is better to use for a repeated measures two way anova. I have two factors, L (five levels) and T (two levels). L and T are both crossed factors (all participants do all combinations). So, I do: summary(aov(dat~L*T+Error(participant/(L*T)),data=dat4)) But get different results with:
2012 Nov 03
2
reorder() in the latticeExtra library
Hello all, thanks for your time and help. Below are my commands, and it generates a really nice plot, however I am not happy with the reorder() function. I would like the order to be the same as they appear in the genotype variable "genotype <- c("CJ1450 NW 4/25/12","CJ1450 BAL 4/25/12","CJ1450 NW 4/27/12","CJ1450 BAL 4/27/12","CJ1721 NW
2013 Apr 08
3
Reshaping a table
Hello all, I have data in the form of a table: X Y1 Y2 0.1 3 2 0.2 2 1 And I would like to transform in the form: X Y 0.1 Y1 0.1 Y1 0.1 Y1 0.1 Y2 0.1 Y2 0.2 Y1 0.2 Y1 0.2 Y2 Any ideas how? Thanks in advance, IOanna [[alternative HTML version deleted]]
2012 Jul 14
2
Arrange two columns into a five variable dataframe
Hi, I hope that folks can give me some simple approaches to taking the data set below, which is accumulated in two columns called "long" and "group", then arrange the data is the "long" column into a data frame containing five variables: "Group 1", "Group 2", "Group 3", "Group 4", and "Group 5". I am hoping for a few
2012 Oct 12
3
Columns and rows
Hi, Could you please advice some easy way to do the following for a dataframe (header=F) having unequal column- & row- length. 1. Combine/stack/join contents from - a) multiple rows into one column. b) multiple columns into one row. 2. Stack contents from multiple columns (or, rows) into one column (or, row). Thank you. Cheers, Santana [[alternative HTML
2013 Jan 05
3
Need help with time series data
Dear R users, Could you share your knowledge on following problem: Suppose we have dataframe: ID TIME Data1 Data2 Data3 ........... Data700 1. 2013-01-01 00:00:00 34 53 66 ............ 55 2. 2013-01-01 00:00:01 333 4 5 ............ 50 3. 2013-01-01 00:00:02 and so
2012 Sep 24
3
List creation based on matrix
Hi guys, It would be great if you could help me with this one... I'm looking to create a script to convert a matrix of species abundance e.g: <http://r.789695.n4.nabble.com/file/n4643978/species_matrix.jpg> into two vectors e.g: <http://r.789695.n4.nabble.com/file/n4643978/communitylist.jpg> ---------------- If you feel there is no easy answer to this and that it would be
2012 Dec 17
3
Merge more than 2 dataframe
Hello. I have for example 4 or more dataframe which like such this example: date value 2006-11 0.4577647 2006-12 NaN 2006-10 0.1577647 2006-11 0.3577647 2006-12 NaN 2007-01 NaN 2007-02 NaN 2007-03 0.2956429 2007-01 0.3677647 2007-02 NaN They have the same length. I need merge by date undefined number of dataframes. End result output will look like
2012 Oct 19
4
Creating a new by variable in a dataframe
Hello, I have a dataframe w/ 3 variables of interest: transaction,date(tdate) & time(event_tim). How could I create a 4th variable (last_trans) that would flag the last transaction of the day for each day? In SAS I use: proc sort data=all6; by tdate event_tim; run; /*Create last transaction flag per day*/ data all6; set all6; by tdate event_tim; last_trans=last.tdate; Thanks
2012 Jul 14
2
Help for Fisher's exact test
Hi, R-help, I have a group of data from RNA-seq want to be analyzed by Fisher's exact test in R. I want to compare the significant difference of about 30,0000 individuals in two different samples, and I have no idea how to use R, so could you please give me some suggestions or the scripts for Fisher's exact test? Thank you very much. Best, Guanfeng Wang [[alternative HTML version
2012 Oct 26
3
regression analysis in R
Dear useRs, i have vectors of about 27 descriptors, each having 703 elements. what i want to do is the following 1. i want to do regression analysis of these 27 vectors individually, against a dependent vector, say B, having same number of elements.2. i would like to know best 10 regression results, if i do regression analysis of dependent vector against the random combination of any 4
2012 Jun 22
4
Search list of elements for a specific pattern
Hi, I have a list of mutations, called "mutList", of the form: > head(mutList) Alu 1 AluJ 2 AluJ/F(R)AM 3 AluJ/FLAM 4 AluJ/FRAM 5 AluJ/monomer 6 AluJb It contains about 500 elements and not all of them contain the sequence "Alu". I tried using this code: Alu<-mutList[which(grep("Alu",mutList)==1)] But that simply returned
2012 Jun 28
6
How can I make a list using aggregate function?
Hi friends, I need to generate a list, that should contain the quantile value of one column in a data frame. while I am compiling this one i am facing one bug,, Really I cannot find out that where the problem has occurred? Could any one help me to come out from this bug?? Here is the code, data <- lapply(comb.data$zFE, function(x) aggregate(x,
2012 Nov 19
6
How to subset my data and at the same time keep the balance?
Hi guys, I have 1000 rows of a dataset. In my analysis, I need 70% of the data, run my analysis and then use the remaining 30% to test my model. Could anybody kindly help me on this? Cheers