similar to: adding row ID numbers by group

Displaying 20 results from an estimated 20000 matches similar to: "adding row ID numbers by group"

2011 Aug 17
2
dotchart vs. dotplot ... groups
I'm trying to create a dotplot with some grouping. I've been able to create what I want using dotchart (basic graphics), but can't quite get it using dotplot (lattice). I prefer to use lattice (or ggplot2) because I think it's a bit easier to control some other aspects of the plot appearance. Basically, w/ lattice I've not been able to get the y-axis label to include the
2011 Nov 29
2
how to transform a data file
Hello R people, I have a data file with 101 numeric variables: one variable called IDN (the individual's unique id number, which I need to retain, and which ranges from 1000 to 1320; some numbers are obviously skipped), and V1 to V100 (each has a value of 0 or 1; these 100 variables represent sequentially ordered days and whether a characteristic was present or absent--e.g., v1 is day 1 and a
2011 Nov 22
1
Rcmdr numSummary: means of multiple variables without grouping
Hello there, when using the function numSummary in Rcmdr and selecting more than one variable (without grouping), the grand mean across all variables is returned for each variable instead of the mean of each single variable. However, this happens only for the mean, and not for sd, quantiles and na. This is the output: > numSummary(dataset1 [,c("var1", "var2")],
2008 Nov 15
3
I want my row name to be a variable
Hi R users Imagine this data.frame: >X Var1 Var2 A 22 13 B 5 2 C 12 8 D 1 99 A,B,C,D are the rows names (or index) Is there a way to create a new variable in this data frame which name is Var3 and which contains the rows names: Var1 Var2 Var3 A 22 13 A B 5 2 B C 12 8 C D 1 99
2007 Aug 05
1
t-test
Hi all, i'm trying to run a two-sample t-test. i have a longitudinal data that looks like this: idn age class 1 22 1 1 22 1 1 22 1 1 22 1 2 63 3 2 63 3 2 63 3 3 43 2 3 43 2 3 43 2 3 43 2 3 43 2 3 43 2 4 37 1 4 37
2010 Jun 14
1
How to convert data frame row to vector?
Hi, I have a data frame that looks like this: ID Var Var2 Var3 xxx 100 909 920 yyy 110 720 710 zzz 140 680 690 I can load the file and produce a plot from values from one column. > data <- read.csv("test.csv") > barplot(data$Var2) So far it's fine. The data frame however has more columns with integer values
2007 Jul 18
1
filter out observation by condition
hello, I have a longitudinal data: idn mort30 newinfec 1 0 1 1 0 1 1 0 1 1 0 1 2 1 1 2 1 1 2 1 1 3 0 0 3 0 0 3 0 0 3 0 0 3
2010 Nov 08
2
Several lattice plots on one page
Dear all, I am trying (!!!) to generate pdfs that have 8 plots on one page: df = data.frame( day = c(1,2,3,4), var1 = c(1,2,3,4), var2 = c(100,200,300,4000), var3 = c(10,20,300,40000), var4 = c(100000,20000,30000,4000), var5 = c(10,20,30,40), var6 = c(0.001,0.002,0.003,0.004), var7 = c(123,223,123,412), var8 = c(213,123,234,435), all = as.factor(c(1,1,1,1)))
2009 Jan 13
3
Comparing elements for equality
Suppose I have a dataframe as follows: dat <- data.frame(id = c(1,1,2,2,2), var1 = c(10,10,20,20,25), var2 = c('foo', 'foo', 'foo', 'foobar', 'foo')) Now, if I were to subset by id, such as: > subset(dat, id==1) id var1 var2 1 1 10 foo 2 1 10 foo I can see that the elements in var1 are exactly the same and the elements in var2 are exactly
2009 Aug 18
1
adding points to a wireframe
A quick question. I'm trying to plot a surface from a fitted model along with the original points, as in the following example: df<-data.frame(expand.grid(100*runif(1:100), 100*runif(1:100))) df$Var3<-rnorm(length(df$Var1), mean=df$Var1*df$Var2, sd=10) my.lm<-lm(Var3 ~ Var1*Var2, data=df) my.fun<-function(x,y) predict(my.lm, data.frame(Var1=x, Var2=y),
2012 Jan 16
3
Select rows based on multiple comparisons
Dear all, I have a data set in which the same unit appears 2 or 3 or 4 times. I need to aggregate this data to maintain only one unit by row. But I need to do that based on a comparison between the values of such units. I can't find a function to help me on that. I appreciate any help. Below I provide an example of what I want: This is my data: Units Var1 Var2 Var3 1 B 2
2006 Jul 20
3
Permutation Distribution
Hallo Is there an elegant way to do the following: Dataset consists of 2 variables: var1: some measurements, and var2: a grouping variable with two values, 1 and 2. There are (say) 10 measurements from group 1 and 15 measurements from group 2. The idea is to study the permutation distribution of mean(group 1) * mean(group2). One way would be to permute 1s and 2s and select the corresponding
2012 Feb 21
1
Managesieve AUTHENTICATE with IDN using UTF-8 or encode into ACE?
Hey dovecot-users, clients that speak telnet based protocols like http, smtp usually encode IDN (International Domain Names) containing UTF-8 characters into ACE (ASCII Compatible Encoding) punycode. I am wondering what the case was with managesieve (RFC 5804). For example if I was using a username like "user@???.example.com" with the AUTHENTICATE command. Would that need to be encoded
2012 Feb 09
1
Tukey HSD
Hey Folks: New to R and learning as I go, but really, I know just enough to get myself into trouble. I've waded through everything up till now, and don't see anything in the search that is directly helpful for the POS that I've created. The GOAL: All I want in the world is a program that performs 1-way ANOVA's on every column in a data set (taking the first column as the
2009 Sep 21
5
More elegant way of excluding rows with equal values in any 2 columns?
Hello, dear R-ers! I built a data frame "grid" (below) with 4 columns. I want to exclude all rows that have equal values in ANY 2 columns. Here is how I am doing it: index<-expand.grid(1:4,1:4,1:4,1:4) dim(index) # Deleting rows that have identical values in any two columns (1 line of code):
2008 Jul 16
2
Group level frequencies
Dear List, I have Multi-level Data i= Indivitual Level g= Group Level var1= First Variable of interest var2= Second Variable of interest and I want to count the frequency of "var1" and "var2" on the group level. I found a way, but there must be a much simpler way. data.ml <- data.frame(i=c(1:8),g=as.factor(c(1,1,1,2,2,3,3,3)),var1=c(3,3,3,4,4,4,4 ,4),
2002 Jul 09
3
Assignment converts variable to factor
Hello, I would like to know if this behaviour in R is as expected. I have a data frame 'dat' with column var1 being character (and not factor). Then I create a new column 'var2' by: > dat[,"var2"] <- dat$var1; Column var2 is now a factor. But if I do: > dat$var2 <- dat$var1; Then column var2 is character (and not factor). I don't want to have
2020 Nov 22
1
Dovecot alternatives with good i18n support?
Hello! I?m interested in exploring alternative IMAP servers that have good support for internationalised email, such as support for SMTPUTF8, IDN mail domains, Unicode local-part, etc. etc. If you used to use Dovecot, and found an alternative that does such things well, I would very much like to hear it. Thank you, -- David
2009 Sep 22
3
converting a character vector to a function's input
Hi all, I have been trying to solve this problem and have had no luck so far. I have numeric vectors VAR1, VAR2, and VAR3 which I am trying to cbind. I also have a character vector "VAR1,VAR2,VAR3". How do I manipulate this character vector such that I can input a transformed version of the character vector into cbind and have it recognize that I'm trying to refer to my numeric
2000 Oct 10
1
Adding a new column to data frame (recoding)
Dear R users, I have a very simple question. What is the easiest way to recode data in one of the columns of a data frame and put it into a new column? For example, here is a simple data frame: var1 1 1 2 2 3 3 How do I add a new column to data - 'var2' in which I group values in 'var1', for example: var1 var2 1 1 4 2 2 4 3 3 5 It's got to