Displaying 20 results from an estimated 20000 matches similar to: "ask a question about data sets element"
2008 Mar 25
2
Compare two data sets
I would like to compare two data sets saved as text files (example below) to determine if both sets are identical(or if dat2 is missing information that is included in dat1) and if they are not identical list what information is different between the two sets(ie output "a1", "a3" as the differing information). The overall purpose would be to remove "a1" and
2009 Oct 29
3
Removing & generating data by category
Dear R users,
Basically, from the following arbitrary data set:
a <-
data.frame(id=c(c("A1","A2","A3","A4","A5"),c("A3","A2","A3","A4","A5")),loc=c("B1","B2","B3","B4","B5"),clm=c(rep(("General"),6),rep("Life",4)))
> a
2009 Apr 26
2
Help to select the raw in a data.frame with the max value
Dear User,
thank for the attention. I have a data.frame with 5 columns (ex:ID,
a1,a2,a3,a4) and 1000 rows. I wish to find the absolute max value for all
data.frame and save a new data.frame with the row where is that value. Ex:
ID: 1,2,3,4,5,6,7,8,9,10
a1:1,2,3,4,5,6,7,8,9,10
a2:11,12,13,14,15,16,17,18,19,20
a3:21,22,23,24,25,26,27,28,29,30
a4:31,32,33,34,35,36,37,38,39,40
The
2017 Oct 09
3
Merge me agrega siempre las columnas
Buenas,
Tengo dos data.frames de la siguiente manera
library(data.table)
id<-c("a1","a2","a3","a4")
id2<-c("a2","a3","a1","a4")
y<-c(1,2,3,4)
z<-c(3,5,6,7)
k<-c(1,3,8,7)
df1<-data.table(id,y,z)
id<-c("a2","a3","a1","a4")
df2<-data.table(id,x,y)
Quiero
2005 Mar 19
2
simple problem, but not for me
Hello, I'm new in R and I want to do one thing that is very easy in excel, however, I cant do it in R.
Suppose we have the data frame:
data<- data.frame(A=c("a1","a2","a3","a4","a5"))
I need to obtain another column in the same data frame (lets say B=c(b1,b2,b3,b4,b5) in the following way:
b1=a1/(a1+a2+a3+a4+a5)
2009 Sep 04
1
User defined function's argument as Subset function's input
Dear R users,
I have a data where I desire to subset according to certain conditions.
However, the script is very messy as there are about 30 distinct conditions.
(i.e. same script but with different conditions)
I would like to make a user defined function so that I can input the desired
conditions and just get the results accordingly.
Below is an arbitrary data set & sample statements
2008 Sep 23
1
Summing up columns with NA elements in a data frame
Hi all,
When I try to sum a few columns in a data frame (which has NA?s randomly distributed as elements), I am not able to get the summing operation to ignore the NA?s.
Let me explain with the following code :
################################?
a<-structure(list(a1 = c(NA, 2, 3, NA, 5, 6, NA, 8, 9, NA), a2 = c(NA,
+ 4, 5, 5, NA, 7, 8, 8, NA, 10), a3 = c(2, NA, 6, 8, NA, 12, 14,
+ NA, 18, 20)),
2010 Apr 13
2
sensitivity analysis, input factors
Hi,
I'm trying to conduct sensitivity analysis in R using the 'sensitivity' package. Although the description of functions seem straightforward, I can?t succeed. The definition of input factors can be the problem.
library(sensitivity)
#A simple model with 4 input factor to test the morris function:
model01=function(a1,a2,a3,a4)
{
Z<-numeric(10)
Z[1]<-runif(1)
2018 May 27
1
if else with 4 conditions problem
Hi everyone,
I have two columns:
? ?A? ? ? ? ? ? ? ?B
? ?1? ? ? ? ? ? ? ?1? ?1? ? ? ? ? ? ? ?0
? ?0? ? ? ? ? ? ? ?1
? ?0? ? ? ? ? ? ? ?0
I have 4 categories which are:
1) if A = 1 and B =1 then A1 = 1, else A2 = 0, A3 = 0, A4 = 0
2) if A = 1 and B =0 then A1 = 0, else A2 =1, A3 = 0, A4 = 0
3) if A = 0 and B = 1 then A1 = 0, else A2 = 0, A3 = 1, A4 = 0
4) if A = 0 and B =0 then A1 = 0, else A2 =
2010 Sep 27
2
subtraction based on two groups in a dataframe
Hello
I have a data set like below:
plate.id well.id Group HYB rlt1
1 P1 A1 Control SKOV3hyb 0.190
2 P1 A2 Control SKOV3hyb 0.210
3 P1 A3 Control SKOV3hyb 0.205
4 P1 A4 Control SKOV3hyb 0.206
5 P1 A5 Control SKOV3hyb 0.184
385 P1 A1 ovca SKOV3hyb 0.184
386 P1 A2 ovca SKOV3hyb 0.229
387
2009 Jan 11
4
How to get solution of following polynomial?
Hi, I want find all roots for the following polynomial :
a <- c(-0.07, 0.17); b <- c(1, -4); cc <- matrix(c(0.24, 0.00, -0.08,
-0.31), 2); d <- matrix(c(0, 0, -0.13, -0.37), 2); e <- matrix(c(0.2, 0,
-0.06, -0.34), 2)
A1 <- diag(2) + a %*% t(b) + cc; A2 <- -cc + d; A3 <- -d + e; A4 <- -e
fn <- function(z)
{
y <- diag(2) - A1*z - A2*z^2 - A3*z^3 - A4*z^4
2008 Feb 10
2
reshape
Dear colleagues,
I'd like to reshape a datafame in a long format to a wide format, but
I do not quite get what I want. Here is an example of the data I've
have (dat):
sp <- c("a", "a", "a", "a", "b", "b", "b", "c", "d", "d", "d", "d")
tr <- c("A",
2005 Aug 15
2
queer data set
I have a dataset that is basically structureless. Its dimension varies
from row to row and sep(s) are a mixture of tab and semi colon (;) and
example is
HEADER1 HEADER2 HEADER3 HEADER3
A1 B1 C1 X11;X12;X13
A2 B2 C2 X21;X22;X23;X24;X25
A3 B3 C3
A4 B4 C4 X41;X42;X43
A5 B5 C5 X51
etc., say. Note that a blank
2003 Dec 17
1
TODO hardlink reporting problem - fixed?
On Mon, 15 Dec 2003, jw schultz <jw@pegasys.ws> wrote:
> OK, first pass on TODO complete.
....
This hardlink bug report is nearly 21 months old... So I took a look
at it using 2.5.7. See below.
> BUGS ---------------------------------------------------------------
>
> Fix hardlink reporting 2002/03/25
> (was: There seems
2004 Sep 28
3
sapply behavior
Hi,
I use sapply very frequently, but I have recently noticed a behavior of
sapply which I don't understand and have never seen before. Basically,
sapply returns what looks like a matrix, says it a matrix, and appears to
let me do matrix things (like transpose). But it is also a list and behaves
like a list when I subset it, not a vector (so I can't sort a row for
instance). I
2012 Dec 16
3
averaging X of specific Y (latitude)
Hello
I have a table describing butterfly range traits.
It is composed of three columns as below
Species name range size (X) latitude of range midpoint (Y)
There are 11 kinds of butterflies.
Each has its range size, and the latitude of each range midpoint ranges
from 9 to 19.
I would like to have the average range size of every degree of latitude.
For example, the average range
2012 Sep 08
2
How to Rename Column Labels?
Hi,
How do I rename the column labels in the table?
For Instance, if I have a table like this, and I want to have the column labels changed from "A1 A2 A3 A4 A5" to "Mike Kate Michelle Paul Young"
A1 A2 A3 A4 A5
1 33 44 55 66 77
2
3
4
5
6
7
7
8
9
and my text file location is: ""/Users/MAC/Desktop/data.txt"
When I type in
2009 Jul 29
1
Subtract matrices within arrays along indices
I have the following array: 3 dimensional object, one dimension being year.
Object is 3*3*3
library(plyr, reshape)
a1<-rep(c(2007,2008,2009),9)
a2<-c(rep("a",9),rep("b",9),rep("c",9))
a3<-c(rep(c(rep(1,3),rep(2,3),rep(3,3)),3))
a4 <- rnorm(27)
A<-data.frame(cbind(comp=a2,val=a3, year=a1, a4))
A1<-melt(A, id=c("year", "comp",
2013 Feb 07
1
Merging data in arrays
Dear All,
Here is a hypothetical sample (sorry for the clumsy code):
A1 <- matrix(1:5, nrow=5, ncol=1)
A2 <- matrix(6:10, nrow=5, ncol=1)
A3 <- matrix(11:15, nrow=5, ncol=1)
A4 <- matrix(16:20, nrow=5, ncol=1)
A5 <- matrix(21:25, nrow=5, ncol=1)
A6 <- matrix(26:30, nrow=5, ncol=1)
B1 <- matrix(c(A1, A2, A3), nrow=5, ncol=3)
B2 <- matrix(c(A2, A3, A4), nrow=5, ncol=3)
B3
2008 Aug 05
2
Create data frame from header only
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20080804/8b871b75/attachment.pl>