search for: df0

Displaying 20 results from an estimated 20 matches for "df0".

Did you mean: db0
2005 Feb 04
1
(no subject)
...An example is given by the following code. >int <- as.factor(paste("[", rep(10, 11), ",", seq(20,120, by=10), ")")) >nsamA <- c(62, 83, 118, 151, 180, 201, 212, 215, 216, 217, 218) >nsamB <- c(65, 90, 128, 163, 190, 199, 209, 214, 215, 216, 218) >df0 <- data.frame(int, nsamA, nsamB) >df0 Since the interval [10, s) with n_s samples is nested in [10, t)with n_t sample for s < t, we know n_s - n_t samples exist in the interval [s, t). If this sample size of the difference is small I want to exclude the interval [10,s). This can be done c...
2010 Oct 20
2
rowsum
Hello, I am trying to achieve something which I *think* is possible using rowsum, but a little help should be useful: Consider the following dataframe DF0: A B C 89 1 140 89 06 20 89 29 137 89 52 13 89 57 10 89 97 23 89 1 37 89 1 12 89 1 3 52 1 11 52 1 31 52 1 16 52 1 6 52 1 10 52 1 13 52 1 10 52 1 25 52 1 2 52 59 38 52 97 75 57 1 14 57 1 13 57 1 14 57 114 12 57 1 23 57 06 26 I need create a new dataframe containing the sums of all the rows where...
2013 Mar 16
1
Errors or warnings for non-existent data
Good Evening Is there a setting that I can change in R so that I get either a warning or an error message if I reference non-existent data in a data frame? For example I get no warning or error message with the following: > set.seed(2013) > df0=data.frame(cbind(x=rnorm(1000),y=rnorm(1000))) > df0$z=df0$w > head(df0) x y 1 -0.09202453 1.51179695 2 0.78901912 -0.60084547 3 -0.66744232 -0.02180077 4 1.36061149 -0.74909011 5 1.50768816 -2.25128946 6 -2.60754997 0.43708800 Thanks Joe [[alternative HTML versi...
2016 Oct 11
2
Colapsar una matriz con NA en una única fila
...sería así: V1 V2 V3 a33 <NA> 10-04 <NA> <NA> <NA> <NA> d52725 <NA> <NA> <NA> <NA> Y quiero lograr algo así V1 V2 V3 a33 d52725 10-04 Mi script es así: Nombre.1<-colnames(df0) #df0 es el dataframe que obtengo con NA df<-data.frame(1) #inicio un nuevo data frame con una variable sin nombre y valor 1 for (i in Nombre.1) {merge(df, subset(paste("df0$",i,sep=''),!is.na(paste("df0$",i,sep=''))))} #el loop Cualquier ayuda será apre...
2016 Oct 11
3
Colapsar una matriz con NA en una única fila
...> > <NA> d52725 <NA> > > <NA> <NA> <NA> > > > > Y quiero lograr algo así > > > > V1 V2 V3 > > a33 d52725 10-04 > > > > Mi script es así: > > > > Nombre.1<-colnames(df0) #df0 es el dataframe que obtengo con NA > > > > df<-data.frame(1) #inicio un nuevo data frame con una variable sin nombre y > > valor 1 > > > > > > for (i in Nombre.1) > > {merge(df, subset(paste("df0$",i,sep=''),!is.na(paste("d...
2015 Aug 02
3
ayuda con análisis de supervivencia
...regresión de Cox y gráficas)? Si a alguien se anima a contestar, adjunto un link con los datos (.Rdata) y el script que he utilizado en el análisis. https://www.dropbox.com/s/d96itird8ms42yx/dataframe.Rdata?dl=0 <https://www.dropbox.com/s/d96itird8ms42yx/dataframe.Rdata?dl=0> sapply(levels(df0$bmi0),function (x){ #####SURVIVAL CURVE dfx=filter(df0,bmi0==x) surv2=Surv(dfx$bmi,dfx$MetS) km2=survfit(surv2~dfx$apoe4)##start.time=20,type='kaplan') plot(km2,lty=2:1,xlim=c(20,41),xlab='BMI at onset',main=x,mark.time = F) legend('bottomleft',c('E4',...
2007 Mar 14
0
cannot delete the last column of a dataframe using "[<-" (PR#9565)
Hi, If df is a dataframe, its last column can't be deleted using "[<-", but other columns can be deleted this way. Example: > (df <- df0 <- data.frame(x = 1:3, y = 4:6, z = 7:9)) x y z 1 1 4 7 2 2 5 8 3 3 6 9 > df[, "z"] <- NULL Error in x[[jj]] : subscript out of bounds > df[, 3] <- NULL Error in x[[jj]] : subscript out of bounds > df["z"] <- NULL Error in x[[jj]] : subscript out of bounds...
2008 Nov 29
2
Reading mixed tables
Dear R buddies, This weekend I became interested in solving Google Code Jam problems using R. I guess R may work very well in this kind of contests but the input of file has been a problem for me. Take this case for example (http://code.google.com/codejam/contest/dashboard?c=agdjb2RlamFtchALEghjb250ZXN0cxjRzBQM), the files are usually of the form: A(number of lines for group 1) a11 a12 a13 a21
2012 Apr 25
2
GFI en modelos estructurales con lavaan
Se ha borrado un adjunto en formato HTML... URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20120425/dafc9a68/attachment.html>
2011 Nov 29
2
Help with recast() syntax
Dear Help-Rs,   I have data similar to the following:   DF <- structure(list(X = 1:22, RESULT = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("NEG", "POS"), class = "factor"), YR_MO = c(201011L, 201012L, 201101L, 201102L, 201103L, 201104L, 201105L, 201106L, 201107L, 201108L, 201109L, 201011L,
2012 Jan 13
2
read.table as integer
Hello, I have a csv file with many variables, both characters and integers. I would like to load it on R and do some operations on integer variables, the problem is that R loads the entire dataset considering all variables as characters, instead I would like that R makes the distinction between the two types, because there are too many variables to do: x1<-as.integer(x1)
2012 Feb 23
1
segfault when using data.table package in conjunction with foreach
...1.0.3 MY CODE: computeAllPairSums <- function(filename, nbindiv,nrows.to.read) { con <- file(filename, open="r") on.exit(close(con)) ans <- matrix(numeric(nbindiv * nbindiv), nrow=nbindiv) chunk <- 0L while (TRUE) { #read.table faster than scan df0 <- read.table(con,col.names=c("ID1", "ID2", "ignored", "sharing"), colClasses=c("integer", "integer", "NULL", "numeric"),nrows=nrows.to.read,comment.char="") DT <- data.table(df0)...
2018 Dec 17
0
Documentation examples for lm and glm
...e below? No, but it is *normally* or *usually* the best option, in my opinion. Best, John > > regards, > > Heinz > > ### trivial example > plotwithline <- function(x, y) { > plot(x, y) > abline(lm(y~x)) ## data argument? > } > > set.seed(25) > df0 <- data.frame(x=rnorm(20), y=rnorm(20)) > > plotwithline(df0[['x']], df0[['y']]) > > > > Fox, John wrote/hat geschrieben on/am 17.12.2018 15:21: >> Dear Martin, >> >> I think that everyone agrees that it?s generally preferable to use the d...
2018 Dec 14
7
Documentation examples for lm and glm
FWIW, before all the examples are changed to data frame variants, I think there's fairly good reason to have at least _one_ example that does _not_ place variables in a data frame. The data argument in lm() is optional. And there is more than one way to manage data in a project. I personally don't much like lots of stray variables lurking about, but if those are the only variables out
1997 Apr 30
2
R-alpha: New Incomplete Beta Function
Here is a drop-in replacement for the R incomplete beta function. src/math/pbeta.c It is a slightly modified version of the cephes library one from Netlib. In the few cases I tried it seems to give at least 14 digit agreement with the one in S-PLUS (its hard to get more). I'm not sure what performance is like. I'd like to know if it helps with some of the problems which have been
2012 Feb 13
3
Change dataframe-structure
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt. Name: nicht verf?gbar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120213/d2a5afa6/attachment.pl>
2001 May 31
1
failure in make check
...ing tested, I find > > ## loess.control : > f <- get("loess.control", pos = 2) ... lines that look ok omitted ... > f(l0) Error in all(arg == choices) : Object "l0" not found > f(c0) Error in all(arg == choices) : Object "c0" not found > f(df0) Error in all(arg == choices) : Object "df0" not found > f(F) Error in pmatch(x, table, duplicates.ok) : argument is not of mode character > f(list(),list()) $surface [1] "interpolate" $statistics [1] "approximate" $trace.hat [1] "exact" $cell [1]...
2005 Aug 27
2
Softlinking to a dvd-drive with inconsistent mount points? => HAL-Support
...hanged my system. When a different medium (Disk) was needed and not present, the first system asks: 'Please insert Volume "Application, Disk 2" in any Drive'. The system detected the Media-Change and closed the Requester automatic, no matter in which Drive you inserted the Disk (DF0:, DF1: DF2 or DF3: for Floppy-Disks). Even the Requester was created automatic, when the required medium was not found and the Application did not forbid this behaviour explicit. About 20 Years later in 1994, a different System told me to insert the "Installation CD #2" in drive "...
2011 Mar 07
5
Parsing question, partly comma separated partly underscore separated string
Dear R-list, I have a partly comma separated partly underscore separated string that I am trying to parse into R. Furthermore I have a bunch of them, and they are quite long. I have now spent most of my Sunday trying to figure this out and thought I would try the list to see if someone here would be able to get me started. My data structure looks like this, (in a example.txt file) Subject
2000 Aug 16
1
samba errormessages
..... [DB0] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ [DC0] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ [DD0] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ [DE0] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ [DF0] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ [E00] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ [E10] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ [E20] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ [E30] 00...