Displaying 20 results from an estimated 11358 matches for "df".
Did you mean:
fd
2017 Jan 23
2
undefined symbols during linking LLDB 4.0 RC1
...__gmon_start__
0000000000000000 w D *UND* 0000000000000000 _ITM_deregisterTMCloneTable
0000000000000000 w D *UND* 0000000000000000 _ITM_registerTMCloneTable
0000000000000000 w D *UND* 0000000000000000 _Jv_RegisterClasses
0000000000000000 DF *UND* 0000000000000001 Base _ZNSt3__114__shared_countD2Ev
0000000000000000 DF *UND* 0000000000000025 GLIBC_2.2.5 sigaltstack
0000000000000000 DF *UND* 0000000000000011 Base _ZTv0_n24_NSt3__114basic_iostreamIcNS_11char_traitsIcEEED1Ev
0000000000000000 DF *UND* 0000000...
2017 Jan 19
2
undefined symbols during linking LLDB 4.0 RC1
Hello, I update my building scripts to build LLVM 4.0 RC1 (with clang, lldb, libc++, libc++abi, lld) on CentOS 6 and I got a lot of undefined symbols during linking LLDB.
I'm using clang-3.9 and this configuration:
-DLLVM_TARGETS_TO_BUILD="X86"
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=/usr/bin/clang
-DCMAKE_CXX_COMPILER=/usr/bin/clang++
2009 Apr 16
0
Lin Model with interactions
Hi all,
I have a question about linear model with interaction:
I created a data frame df like this:
>df
V1 V2 V3 V4 V5
1 6.414094 c t a g
2 6.117286 t a g t
3 5.756922 a g t g
4 6.090402 g t g t
...
which holds the response in the first column and letters (a,c,g,t) in the
other columns. I am interested to see if there are interactions between the
neigbourin...
2009 Apr 17
0
Linear model with interaction
Hi all,
I have a question about linear model with interaction:
I created a data frame df like this:
>df
V1 V2 V3 V4 V5
1 6.414094 c t a g
2 6.117286 t a g t
3 5.756922 a g t g
4 6.090402 g t g t
...
which holds the response in the first column and letters (a,c,g,t) in the
other columns. I am interested to see if there are interactions between the
neigbourin...
2014 Mar 10
3
Frecuencia absoluta acumulada por individuo y por año
...Pero si el siguiente año es del mismo
ID, acumula el valor de la cantidad que hemos introducido en esa fila...
Con el siguiente código se resuelve este error y además ya está preparado
para contemplar cualquier tipo de salto en años.
He modificado un para de años sobre el resultado inicial del sqldf para
mostrarlo.
El problema de este código es que son dos bucles seguidos...pero resuelve
la situación...
#----------------------------------------------------------------------
Lines <- "ROW ID FECHA YEAR CANTIDAD
1 100 2005-08-02 2005 1
2 100 2005-10-19 2005 2
3 100...
2009 Jul 13
1
Help get this simple function to work...
...as one object, ID. If I run
the loops by themselves using a character value (ie,"VFFF1-7") instead of
the function object, then the loops work fine. However, when I try to
insert the character value via the function call, it doesn't work. I don't
get an error, but the TotalCover.df dataframe does not update according to
the loop criteria. Any obvious problems that you can see?
################Cover Function#########################
#Define Variables
Quadrats.df<-unique(data.df$Quadrat)
TotalCover.df<-cbind(0:750/10,0,0,0,0,0,0)
colnames(TotalCover.df)<-
c(&qu...
2011 May 21
4
Looping through values in a data frame that are >zero
...in
2 The entry of column y that is in the same row
3 The entry of column z that is in the same row
It'd be good to save this info in a data frame somehow - so that I
could loop through rows of this data frame.
To explain what I need it for eventually: I have a different data
frame "large.df" that has the same columns (variables) - but with many
more entries than "x". Something like:
large.df<-expand.grid(y,z)
names(large.df)<-c("y","z")
set.seed(123)
large.df$a<-sample(0:5,75,replace=T)
set.seed(234)
large.df$b<-sample(0:5,75,replace=T)
s...
2012 Nov 22
1
Data Extraction - benchmark()
...,
I see you are one of the contributors to the rbecnhmark package.
I am sorry that I am bothering you again. I have tried to run your code (slightly tweaked) involving the benchmark function, and I am getting the following error message. What am I doing wrong?
Error in benchmark(d1 <- s1(df), d2 <- s2(df), d3 <- s3(df), d4 <- s4(df), :
could not find function "s1"
>
> identical (d1,d2), identical (d1,d3), identical (d1,d4), identical (d1,d5), identical (d1,d6)
Error: unexpected ',' in "identical (d1,d2),"
> sessionInfo ()
R version...
2012 Nov 24
5
subsetting - questions
Hello,
I have two very basic questions (console attached):
1) What am I getting an error message for # 5 and # 7 ?
2) How to fix the code?
I would appreciate receiving your help.
Thanks,
Pradip Muhuri
###### Reproducible Example #####
N <- 100
set.seed(13)
df<-data.frame(matrix(sample(c(1:10),N, replace=TRUE),ncol=5))
keep_var <- c("X1", "X2")
drop_var <- c("X3", "X4", "X5")
df[df$X1>=8,] [,1:2] #1
df[df$X1>=8,] [,-c(3,4,5)] #2
df[df$X1>=8,] [,c(-3,-4,-5...
2012 Feb 07
2
Vectorizing a loop
...lks,
I'm trying to vectorize a loop that processes rows of a dataframe. It
involves lots of conditionals, such as "If column 10 == 3, and if column
3 is True, and both column 5 and 6 are False, then set column 4 to True".
So, for example, any ideas about vectorizing the following?
df = data.frame( list(a=c(1,2,3,4), b=c("a","b","c","d"), c=c(T,F,T,F),
d=NA, e=c(F,F,T,T)) )
for (i in 1:nrow(df)) {
if (df[i,3] %in% c(FALSE,NA) & (df[i,1] > 2 | df[i,5]) ) {
df[i,4] = 1
}
if (df[i,5] %in% c(TRUE, NA) & df[i,2...
2009 Jul 19
3
ifelse choices in a data.frame?
...t mathematically, but it
seems forced and won't scale well for nested logic. I have two
examples below writing columns e & f, but I don't think the code is
self-documenting as it depends on knowing that Test is a TRUE/FALSE.
Is there a better way to do the following?
Thanks,
Mark
DF <- data.frame(cbind(a=1:4, b=1:2, c=1:8, d=1:16, e=0, f=0))
DF$Test <- with(DF, a == b)
DF$e = (DF$c*DF$d) * DF$Test + (DF$c+DF$d) * !DF$Test
DF$f = with(DF, (c*d)*Test + (c+d)*!Test)
DF
2009 Jul 13
2
Help me get this function to work...
...ction (see below). This function has one object, ID. If I run the loops by itself using a character value (ie,"VFFF1-7"), then the loops work fine. However, when I try to insert the character value via the function call, it doesn't work. I don't get an error, but the TotalCover.df dataframe does not update according to the loop criteria. Any obvious problems that you can see?
################Cover Function#########################
#Define Variables
Quadrats.df<-unique(data.df$Quadrat)
TotalCover.df<-cbind(0:750/10,0,0,0,0,0,0)
colnames(TotalCover.df)<- c("...
2007 Oct 12
1
Addition operation based on specific columns and rows of two data frames
#Hello,
# I have a question about the addition of values in specific columns and
rows of a Data frame.
# Below I have created two data frames, X.df and "Y.df".
## creation of X.df data frame
X<- matrix(0,16,3)
X.df<-data.frame(X)
X.df[,1] <- c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)
X.df[,2] <- c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4)
names(X.df)[1]<-"L(A)a(i)"
names(X.df)[2]<-"L(B)a(j)"
names(X.df)[3]<-...
2014 Mar 12
3
Frecuencia absoluta acumulada por individuo y por año
...006", "16/04/2007"),
> CANTIDAD = c(1, 2, 1, 1, 1, 1, 5, 1, 3))
>
> class(datos2$FECHA) # Es un factor
>
> datos2$FECHA <- as.Date(datos2$FECHA,"%d/%m/%Y")
> class(datos2$FECHA) # Ahora ya es una fecha
>
>
>
> # Código
>
> library(sqldf)
>
> df.tmp <- sqldf("select ID,YEAR, sum(CANTIDAD) as cusum from datos2 group by ID,YEAR
> order by ID,YEAR")
>
>
> for(i in 1:nrow(df.tmp)) {
> if(i==1 ) {
> df.tmp$difID[i] <- 0
> df.tmp$difYE[i] <- 0
>
> }
> else{
>...
2011 Nov 16
3
create list of names where two df contain == values
Hello again... sorry to be posting yet again, but I hadn't anticipated this
problem.
I am trying to now put the names found in one column in data frame 1 (lets
call it df.1[,1]) in to a list from the rows where the values in df.1[,2]
match values in a column of another dataframe (df.2[3])
I tried to write this function so that it put the list of names (called
Iffy) where the 2 criteria (df.1[141] and df.2[21]) matched but I think its
too complex for a beginner R-...
2011 Mar 11
1
changing one character in the name of dataframes repeatedly
...y to keep this simple because I am not willing to confuse you at all.
I have a little data frame which I have created the following way:
a <-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6)
b <-c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30)
df <-as.data.frame(cbind(a,b))
df
Now in the next step I would have liked to create smaller dataframes where the data have been extracted (basically splitted) from the main 'df' dataframe according to the numbers in df$a. Something like this:
a b
1 1
1 2
1 3
1 4
1 5
a b
2 6
2 7
2 8
2...
2016 Mar 03
5
Representar datos longitudinales mediante splines
...e un spline (o en su defecto algún tipo de línea suavizadora que no necesariamente tenga que pasar por los puntos de cada sujeto). Además, quisiera hacerlo en R básico, esto es, sin recurrir al uso de paquetes adicionales tipo lattice, ggplot2.
A modo de ejemplo, tengo el siguiente data frame:
df <- data.frame(
id = factor(rep(c(1,2,3), c(3,4,3))),
x = c( 1, 14, 22, 2, 9, 20, 25, 4, 15, 22),
y = c(35, 28, 52, 79, 64, 70, 95, 45, 102, 105))
E intento (sin conseguir resultado):
plot(df$x, df$y, xlab = "time", ylab="va...
2011 Jan 10
1
debug biglm response error on bigglm model
...ctors in the seventh iteration. At the end of the output is the
aforementioned error message. Finally, I have included the model from
biglm.
Thanks in advance!
Code:
=======
iter <- nrow(nov.2010)
predict.nov.2011 <- vector(mode='numeric', length=iter)
for (i in 1:iter) {
iter.df <- nov.2010
##---------- Update values of dynamic variables ------------------
iter.df$age <- iter.df$age + 12
iter.df$pct_utilize <-
iter.df$pct_utilize + mc.util.delta[i]
iter.df$updated_varname1 <-
ceiling(iter.df$updated_varname1 + mc.varname1.delta[...
2009 May 04
0
to the person who asked about dividing by the base row
...should probably have
some error checking in there for when it doesn't.?
C) When i tried to condense it to below, I got an error that division is
only valid for equal sized data frames and
I'm not sure why so maybe someone can say something about that ?
temp <- lapply(split(DF,list(DF$sp,DF$wg)), function(.df) {
? ? ? .df[(.df$n != 1),c(3,4,5,6,7)] <- .df[(.df$n !=
1),c(3,4,5,6,7)]/.df[(.df$n == 1),c(3,4,5,6,7)]
? ? ? .df
})
# WORKING CODE
#===========================================================================
?
DF <-...
2006 Dec 27
3
how to transform string to variable name in a fuction?
there is a data frame, like this:
> df
aa bb
1 a 20.27802
2 b 22.10664
3 c 21.33470
4 a 22.32898
5 b 19.73760
6 c 20.38979
.....(suppressed)
what I want to do is to copy the data frame's rows into different data frames according to the levels of 'aa' column,
> df.a <- df[df[,1]==&...