search for: nam1

Displaying 11 results from an estimated 11 matches for "nam1".

Did you mean: na01
2007 Jun 28
3
Function call within a function.
...data.frame(id, cata,catb) # function to create list from data.frame lstfun <- function(file, alpha , beta ) { cda <- subset(file, file[,1] == alpha) cdb <- subset (file, file[,1]== beta) list1 <- list(cda,cdb) } # funtion to operate on list ukn <- function(file, alpha, beta, nam1){ aa <- alpha bb <- beta myfile <- file nts <- lstfun(myfile, aa, bb) mysum <- nam1[,3]*5 return(mysum) } results <- ukn(dd1, "a", "b", nts$cda)
2009 Apr 28
8
duplicate 'row.names' are not allowed
Hi everyone,   I have got the following problem:   x1 <- rnorm(10,5,1) x2 <- runif(10,0,1) nam1 <- paste("A",1:4,sep=".") nam2 <- paste("A",6:9,sep=".") nam <- c(nam1,"A.4",nam2,"A.9") mydata <- data.frame(x1,x2) rownames(mydata) <- nam Error in `row.names<-.data.frame`(`*tmp*`, value = c("A.1", "A.2&...
2006 Feb 26
1
assigning differences in a loop
Dear All I would need to generate differences between variates such as nam1<-nam2-nam3 in the following loop: for(i in c("13","26","38")) { for (j in c("HR","PQ","QRS","QT")){ nam1<-paste("d",j,i,sep="") nam2<-paste(j,i,sep=".") nam3<-p...
2010 Aug 04
6
applying strsplit to a whole column
I am sorry, I'd like to split my column ("names") such that all the beginning of a string ("X..") is gone and only the rest of the text is left. x<-data.frame(names=c("X..aba","X..abb","X..abc","X..abd")) x$names<-as.character(x$names) (x) str(x) Can't figure out how to apply strsplit in this situation - without using a
2017 Jun 04
2
Warning from reshape2 when melting a data frame with uneven number of columns.
Here is a small reproducible example: data <- structure(list(V1 = structure(1:3, .Label = c("Name1", "Name2", "Name3"), class = "factor"), V2 = structure(c(1L, 3L, 2L), .Label = c("nam1", "name-1", "name_12"), class = "factor"), V3 = structure(1:3, .Label = c("nam2", "nam_34", "name-2"), class = "factor"), V4 = structure(c(2L, 3L, 1L), .Label = c("", "nam3", "nam_56"), class =...
2017 Jun 04
0
Warning from reshape2 when melting a data frame with uneven number of columns.
Is this the solution? > d1<- as.data.frame(lapply(data,as.character),stringsAsFactors=FALSE) > str(d1) 'data.frame': 3 obs. of 5 variables: $ V1: chr "Name1" "Name2" "Name3" $ V2: chr "nam1" "name_12" "name-1" $ V3: chr "nam2" "nam_34" "name-2" $ V4: chr "nam3" "nam_56" "" $ V5: chr "" "name_78" "" > melt(d1,id.vars="V1") V1 variable value 1 Na...
2005 Oct 06
1
Compare two distance matrices
Hi all, I am trying to compare two distance matrices with R. I would like to create a XY plot of these matrices and do some linear regression on it. But, I am a bit new to R, so i have a few questions (I searched in the documentation with no success). The first problem is loading a distance matrix into R. This matrix is the output of a the Phylip program Protdist and lookes like this: 5
2012 Oct 29
2
naming datasubsets in a loop
Hello everbody, I want to generate different subsets of my data-set and safe this subsets with names listet in a vector. Because in reality I have got about 70 subsets I want to realize this in a loop Somehow like this: names=c("nam1", "nam2","nam3","nam4","nam5","nam6","nam7","nam8","nam9","nam10") for (i in 1:10){ subset(originaldata, originaldata[ ,130]<=time[i]) #This subset should get the name safed in "names"...
2017 Jun 04
0
Warning from reshape2 when melting a data frame with uneven number of columns.
...e warning means but I think your underlying problem is that all your variables are factors. Did you intend the values in each variable to be character? data.frame':??? 3 obs. of? 5 variables: ?$ V1: Factor w/ 3 levels "Name1","Name2",..: 1 2 3 ?$ V2: Factor w/ 3 levels "nam1","name-1",..: 1 3 2 ?$ V3: Factor w/ 3 levels "nam2","nam_34",..: 1 2 3 ?$ V4: Factor w/ 3 levels "","nam3","nam_56": 2 3 1 ?$ V5: Factor w/ 2 levels "","name_78": 1 2 1 On Sunday, June 4, 2017 6:48 AM, Ash...
2012 Oct 22
6
How to use tapply with more than one variables grouped
I'm studying alone the R language for data preparation. I found a course at MIT for data preparation that uses python but I'm using R to learning. The first exercise is the preparation of data from a database that shows the contributions made to candidates for U.S. president. The database is described in FORMART
2012 Oct 10
7
multiple t-tests across similar variable names
Hi everyone- I have a dataset with multiple "pre" and "post" variables I want to compare. The variables are named "apple_pre" or "pre_banana" with the corresponding post variables named "apple_post" or "post_banana". The variables are in no particular order. apple_pre orange_pre orange_post pre_banana apple_post post_banana person_1