search for: dataf

Displaying 20 results from an estimated 45 matches for "dataf".

Did you mean: data
2008 Oct 01
3
"tapply versus by" in function with more than 1 arguments
...didn't found nothing similar to this. I simplified my example like below: #I need calculate correlation (for example) between 2 columns classified by a third one at a data.frame, like below: #number of rows nr = 10 #the third column is to enforce that I need correlation on two variables only dataf = as.data.frame(matrix(c(rnorm(nr),rnorm(nr)*2,runif(nr),sort(c(1,1,2,2,3,3,sample(1:3,nr-6,replace=TRUE)))),ncol=4)) names(dataf)[4] = "class" #> dataf #            V1             V2                V3                 class #1   0.56933020      1.2529931     0.30774422     1 #2   0.4...
2008 Feb 05
2
obdfilter/datafs-OST0000/recovery_status
...ue with the eval while awaiting a response. I''m using lustre release 1.6.4.2 with the vanilla 2.6.18.8 kernel with a Scientific Linux 5 (derived from RHEL5) distro with e2fsprogs 1.40.4.cfs1. I''m doing the following: aaa() { set -x dmesg -c >/dev/null mkfs.lustre --fsname datafs --mdt --mgs --reformat /dev/sda1 mkfs.lustre --fsname datafs --ost --mgsnode=pool4 at tcp --reformat / dev/sda2 e2label /dev/sda1 e2label /dev/sda2 mount.lustre /dev/sda1 /mnt/data/mdt mount.lustre /dev/sda2 /mnt/data/ost0 dmesg -c >dmesg.0 mount.lustre pool4 at tcp:/datafs /mnt/d...
2008 Oct 02
0
[solutions] "tapply versus by" in function with more than 1 arguments
Thanks to all. I summarized (in order to thank the list) the solutions to help future workers searching subjects like this at R help.   # Number of rows nr = 10 # Data set dataf = as.data.frame(matrix(c(rnorm(nr),rnorm(nr)*2,runif(nr),sort(c(1,1,2,2,3,3,sample(1:3,nr-6,replace=TRUE)))),ncol=4)) names(dataf)[4] = "class" #----------------------------------------------------- #Solution 1: #works, but need space to allocate the new data: splidata   # Splitting your...
2005 Oct 07
1
returning a modified fix()-ed dataframe
...would be this: my.data <- data.frame(age=c(24,35,28), gender=c("Male", "Female", "Male")) require(Hmisc) label(my.data$age) <- "Respondent's age" label(my.data$gender) <- "Responent's gender" variables <- function(x) { dataf <- data.frame(variable=NA, label=NA) varlab <- NA for (i in 1:length(names(x))) { dataf[i,1] <- names(x)[i] dataf[i,2] <- label(x[,i]) varlab[i] <- label(x[,i]) } fix(dataf) # I assume this would...
2010 Jul 22
1
Updating a Data Frame
...tamp #Update the events Data Frame events[events$eventid == eventid, "timestamp"] <<- newTimeStamp events[events$eventid == eventid, "isSynchronized"] <<- 1 events[events$eventid == eventid, "timeDiff"] <<- timeDiff } I call this function like: # dataF is a subset of events if(doUpdate == 1){ if(!is.null(dataF) && nrow(dataF) > 0){ len <- nrow(dataF) for(i in 1:len){ updateDB(dataF[i,"eventid"], dataF[i,"tobiiTime"], dataF[i,"ruiTime"]) } } } However, this particular update functionality is perform...
2006 Mar 07
3
glm automation
...automating multiple glm(s) operations. The data file is tab delimited file with headers and two columns. like "ABC" "EFG" 1 2 2 3 3 4 dat <- read.table("FILENAME", header=TRUE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE) dataf <- read.table("FILENAME", header=FALSE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE) norm1 <- glm(dataf[1,1] ~ dataf[1,2], family= normal(log), data=dat) norm2 <- glm(dataf[1,1] ~ dataf[1,2], family= normal(identity), data=dat) and so on. B...
2009 Aug 12
2
Symbolic references - passing variable names into functions
Hello All, I am trying to write a function which would operate on columns of a dataframe specified in parameters passed to that function. f = function(dataf, col1 = "column1", col2 = "column2") { dataf$col1 = dataf$col2 # just as an example } The above, of course, does not work as intended. In some languages one can force evaluation of a varia...
2011 Nov 15
2
Models with ordered and unordered factors
...s my example code with my comments/ideas along it. Can someone help me to understand what is happening? Thanks a lot in advance; Catarina Miranda y<-c(72,25,24,2,18,38,62,30,78,34,67,21,97,79,64,53,27,81) Day<-c(rep("Day 1",6),rep("Day 2",6),rep("Day 3",6)) dataf<-data.frame(y,Day) str(dataf) #Day is not ordered #'data.frame': 18 obs. of 2 variables: # $ y : num 72 25 24 2 18 38 62 30 78 34 ... # $ Day: Factor w/ 3 levels "Day 1","Day 2",..: 1 1 1 1 1 1 2 2 2 2 ... summary(lm(y~Day,data=dataf)) #Day 2 is not significan...
2004 Jun 24
3
The "median" function in R does not work properly.
Hi, 1.) The "median" function does not work well. Please refer to the data below (same data is attached as txt-delimited). This is what I try to do in R: median ( dataf [2:9] ) I get warning: "needs numeric data" 2.) BUT if apply the median to a single vector: median ( dataf [,2]] ) then it works: 3.) How come the "median" function does not let me take the median of all 8 vectors at once? Obviously, if I can perform...
2008 Dec 01
1
Help with lattice graphics
...;2008","2009");ny<-length(yr) fac_a<-factor(vec_a);fac_b<-factor(vec_b);fac_yr<-factor(yr) n<-na*nb*ny # y is the response variable y<-runif(n);y<-round(y,digits=1) dfa<-rep(fac_a,times=nb*ny) dfb<-rep(fac_b,each=na,times=ny) dfyr<-rep(fac_yr,each=na*nb) dataf<-data.frame(dfa=dfa,dfb=dfb,dfyr=dfyr,y=y);head(dataf) # dataf is the test data frame # First test with the lattice package library(lattice) barchart(y~dfb|dfyr,dataf,layout=c(3,1),beside=FALSE, ????????? groups=dfa, ????????? scales=list(x=list(rot=90)), ????????? par.settings=list(axis.text=li...
2007 Aug 30
2
Announcing an updated document version (v1.7) of the Lustre 1.6 Operations Manual
Dear Lustre users, CFS is pleased to announce an updated document version (v1.7) of the Lustre? 1.6 Operations Manual, available in both PDF and HTML formats at http://www.manual.lustre.org. This edition of the Operations Manual includes the following enhancement: * Addition of mballoc3 content to the Lustre Proc chapter If you have any questions, suggestions, or recommended edits to the
2007 Aug 30
2
Announcing an updated document version (v1.7) of the Lustre 1.6 Operations Manual
Dear Lustre users, CFS is pleased to announce an updated document version (v1.7) of the Lustre? 1.6 Operations Manual, available in both PDF and HTML formats at http://www.manual.lustre.org. This edition of the Operations Manual includes the following enhancement: * Addition of mballoc3 content to the Lustre Proc chapter If you have any questions, suggestions, or recommended edits to the
2007 Aug 30
2
Announcing an updated document version (v1.7) of the Lustre 1.6 Operations Manual
Dear Lustre users, CFS is pleased to announce an updated document version (v1.7) of the Lustre? 1.6 Operations Manual, available in both PDF and HTML formats at http://www.manual.lustre.org. This edition of the Operations Manual includes the following enhancement: * Addition of mballoc3 content to the Lustre Proc chapter If you have any questions, suggestions, or recommended edits to the
2005 Feb 20
2
matrix operations
In R, I'm imported a data frame of 2,321,123 by 4 called "dataF". I converted the data frame "dataF" to a matrix dataM <- as.matrix(dataF) Does R have an efficient routine to treat the special elements that contain "inf" in them. For example, can you separate the rows that have "inf" elements from the matrix into a sepa...
2011 Mar 05
2
please help ! label selected data points in huge number of data points potentially as high as 50, 000 !
...). So I want to display name corresponding to those observations (rows) that have pvalue less than 0.05 (threshold). Here is my example dataset and my status: name <- c(paste ("M", 1:5000, sep = "")) xvar <- seq(1, 50000, 10) set.seed(134) p <- rnorm(5000, 0.15,0.05) dataf <- data.frame(name,xvar, p) # using lattice (my first preference) require(lattice) xyplot(p ~ xvar, dataf) #I want to display names for the following observation that meet requirement of p <0.01. which (dataf$p < 0.01) [1] 811 854 1636 1704 2148 2161 2244 3205 3268 4177 4564 4614...
2010 Aug 12
2
Append to csv without header
...am writing a function that writes to a csv file for every call. However, for the subsequent calls, I want to append the data to the existing csv file without appending the column names again. I tried searching in the previous posts, but I am stuck with different errors. Here is what I am doing (dataF is a data-frame):- outputFilePath <- paste(getwd(), "/", "outputModel.csv", sep=""); counter <- 1 for (userid in userids){ dataF <- getUserData(userid) if(counter == 1){ write.csv(dataF, file = outputFilePath, append=F) }else{ write.csv(data...
2011 Mar 05
1
displaying label meeting condition (i.e. significant, i..e p value less than 005) in plot function
Dear R users, Here is my problem: # example data name <- c(paste ("M", 1:1000, sep = "")) xvar <- seq(1, 10000, 10) set.seed(134) p <- rnorm(1000, 0.15,0.05) dataf <- data.frame(name,xvar, p) plot (dataf$xvar,p) abline(h=0.05) # I can know which observation number is less than 0.05 which (dataf$p < 0.05) [1] 12 20 80 269 272 338 366 368 397 403 432 453 494 543 592 691 723 789 811 [20] 854 891 931 955 I want to display (label) corresponding name...
2013 Jan 26
2
different legends in lattice panels
...andom data lbt <- abs(rnorm(100)) # any biological value de <- rep(1:10,10) # the depth type <- rep(c("A","C","F","S"), c(20,30,40,10)) # the type of sampling zone sta <- as.factor(rep(1:10, c(10,10,10,10,10,10,10,10,10,10))) # the station number dataf <- data.frame(lbt,de,type,sta) # the dataframe # key creation keyA <- list(border = FALSE, text = list(levels(dataf$sta)[1:2]),lines=TRUE,points=TRUE,lty=c(1:2),pch=c(1:2)) keyC <- list(border = FALSE, text = list(levels(dataf$sta)[3:5]),lines=TRUE,points=TRUE,lty=c(3:5),pch=c(3:5)) keyF...
2008 Sep 15
1
randomly sample within clustered data?
...data frame: > id<-c(rep("100", 4),rep("101", 3), rep("102", 6), rep("103", 7)) > sex<-sample(c("m","f"), 20, replace=TRUE) > weight<-rnorm(n=20, mean=150, sd=3) > attitude<-sample(1:7, 20, replace=TRUE) > Dataf<-data.frame(id,sex,weight,attitude) > Dataf id sex weight attitude 1 100 m 146.5064 6 2 100 f 150.2317 4 3 100 f 149.3686 5 4 100 m 144.7218 7 5 101 m 147.9071 4 6 101 m 148.3802 6 7 101 m 154.4634 1 8 102...
2011 Mar 13
1
replace with quantile value for a large data frame...
...25%), second (25% to <50%), third (50% to <75%) and fourth quantiles (>75%) are replaced with 1,2,3, 4 respectively. The following example is just to workout. # my example: X1 <- c(1:10) > X2 <- c(11:20) > X3 <- c(21:30) > X4 <- c(31:40) > X5 <- c(41:50) > dataf <- data.frame(X1, X2, X3, X4, X5) > > # my efforts of the last week led me to this point > for (i along(length(dataf[1,]))) { > qntfun <- function (x) { > XQ <- as.numeric(as.matrix(quantile(x))) > Q1 <- XQ[1] > Q2 <- XQ[2] > Q3 <- XQ[3] >...