Displaying 13 results from an estimated 13 matches for "df5".
Did you mean:
df
2010 Nov 11
4
How to get a specific named element in a nested list
Hello,
I have a nested named list structure, like the following:
x <- list(
list(
list(df1,df2)
list(df3,
list(df4,df5))
list(df6,df7)))
with df1...d7 as data frames. Every data frame is named.
Is there a way to get a specific named element in x?
so, for example,
x[[c("df5")]] gives me the data frame 5?
Thank you in advance!
Best,
Friedericksen
2011 Aug 29
2
splitting into multiple dataframes and then create a loop to work
...orm(40, 5, 2);
var4 <- rnorm(40, 10, 3); var5 <- rnorm(40, 15, 8) # just example
df <- data.frame(clvar, yvar, var1, var2, var3, var4, var5)
# manual splitting
df1 <- subset(df, clvar == 1)
df2 <- subset(df, clvar == 2)
df3<- subset(df, clvar == 3)
df4<- subset(df, clvar == 4)
df5<- subset(df, clvar == 5)
# i tried to mechanize it
*
for(i in 1:5) {
df[i] <- subset(df, clvar == i)
}
I know it should not work as df[i] is single variable, do it did. But I
could not find away to output multiple dataframes from this loop. My limited
R knowledge, did not help...
2006 Nov 03
1
man page for as.matrix for data frames outdated?
...mplexes <- (-1:2)+3i
> df4 <- data.frame(a=fourLogicals, d=fourComplexes, b=fourInts,
c=fourDoubles)
> storage.mode(as.matrix(df4))
[1] "complex"
If one column is of mode character, then 'as.matrix' will effectively
return a character matrix:
> df5 <- data.frame(toto=c("a","bb"), titi=c(9,999))
> storage.mode(as.matrix(df5))
[1] "character"
Note that the doc says that "any non-numeric/complex column" will
be passed thru 'format' which seems to be exactly the other way
around:...
2007 Sep 27
2
create data frame(s) from a list with different numbers of rows
...can figure out how to do this is "one by one" in very
clunky fashion.
# here is an example of my code
sample.df1 <-data.frame(list.sample[[1]])
sample.df2 <-data.frame(list.sample[[2]])
sample.df3 <-data.frame(list.sample[[3]])
sample.df4 <-data.frame(list.sample[[4]])
sample.df5 <-data.frame(list.sample[[5]])
sample.df6 <-data.frame(list.sample[[6]])
sample.df1
sample.df2
sample.df3
sample.df4
sample.df5
sample.df6
# In the future i will have up to 1,200 of these small dataframes to create.
# is there a way to loop through the list and create many small data
frame...
2010 Jan 20
1
Reshaping data with xtabs giving me 'extra' data
...es[1], Show = shows, Score = 1:3)
> df2 <- data.frame(Date = dates[1], Time = times[2], Show = shows, Score = 1:3)
> df3 <- data.frame(Date = dates[1], Time = times[4], Show = shows, Score = 1:3)
> df4 <- data.frame(Date = dates[2], Time = times[1], Show = shows, Score = 1:3)
> df5 <- data.frame(Date = dates[2], Time = times[2], Show = shows, Score = 1:3)
> df6 <- data.frame(Date = dates[2], Time = times[3], Show = shows, Score = 1:3)
> df7 <- data.frame(Date = dates[2], Time = times[4], Show = shows, Score = 1:3)
> df7
Date Time Show Scor...
2012 Feb 18
1
Finicky factor comparison operators
This error occurs because the "==" comparison operator doesn't allow
comparison of ordered and normal factors:
/df[df5$close_quarter == as.Date("2011-02-01"),]/
Warning message:
In /`[.data.frame`(df, df$close_quarter == as.Date("2011-02-01")/, :
Incompatible methods ("Ops.ordered", "Ops.Date") for "=="
Why should this be a problem -- Isn't this being overly...
2012 Jan 26
1
How to remove rows representing concurrent sessions from data.frame?
I have a dataset like this (dput for this below) which represents user
computer sessions:
username machine start end
1 user1 D5599.domain.com 2011-01-03 09:44:18 2011-01-03 09:47:27
2 user1 D5599.domain.com 2011-01-03 09:46:29 2011-01-03 10:09:16
3 user1 D5599.domain.com 2011-01-03 14:07:36 2011-01-03 14:56:17
4 user1 D5599.domain.com
2009 Dec 09
2
Problem with if statement
I am trying to use the value of an ID variable in an if statement and
not getting the results I expected.
# ID values for two school districts
> with(rf, tapply(DistrictID, DistrictName, min) )
Aberdeen School Dist. # 58 Buhl Joint School District
59340 53409
This creates DNAME as I expected ...
2005 Jan 29
7
Sipura SPA-841 auto-answer support [patch]
...;HX5M+3*R-\S$@('O"0\H-=1I`E&7&K=N"19$9E#6/[=-C^DKA>,
M"Q'JV>L&Q)='[FY`F3UYP<+.&]W1EOJ4+>K=4DYV,!`2SPF=^;QP:_D]BEDR
M<WL_=?&,N4KTZ="0@X.<WA+,J#=.V/PPX/YGXBG1#B@'+PO_.R]M:'-8]+GG
MW-YRD)'CT4F"7YL[V"8J[$5B#AW3[=DF5[<IF9(PM,:Q>4[NGTE:L0IJ1#7J
MI:(FX%6.,;YNR('%S&H4T0GJ7G4ZBX7U>,X9"IFUP&Z()A%>++RE(X>,$&`5
M'EQ=7O;ZPV5F@!S')7/N:!?E<K2+<D71];A-"-Q_&?:7P?OD1!.HB&**VL<3
M6TM4W5KN;*%+;#;SB(@;$O%V?(C.)L3^C.XFA$\(0^)!$`V1A>:HCT"-+&%T
M>&qu...
2005 Oct 20
1
Windows 2000 crash while using rbind (PR#8225)
...e(cbind(x=3D1, y=3D1:1000), fac=3Dsample(LETTERS[1:3], =
1000, repl=3DTRUE))
df2 <- data.frame(cbind(x=3D1, y=3D1:10), fac=3Dsample(LETTERS[4:6], =
10, repl=3DTRUE))
df3 <- data.frame(cbind(x=3D1, y=3D1:1000000), =
fac=3Dsample(LETTERS[1:3], 1000000, repl=3DTRUE))
df4 <- rbind(df1,df2)
df5 <- rbind(df2,df3)
=20
=20
Since this only happens intermittantly and appears to be related to the =
size of the objects I ran the following code.
sink("rbind test.txt")
df1 <- data.frame(cbind(x=3D1, y=3D1:10), fac=3Dsample(LETTERS[4:6], 10, =
repl=3DTRUE))
for (j in seq(100000,100...
2004 Mar 09
5
Adding data.frames together
I have a series of data frames that are identical structurally, i.e. -
made with the same code, but I need to add them together so that they
become one, longer, data frame, i.e. - each of the slot vectors are
increased in length by the length of the added data frame vectors.
So if I have df1 with a slot A so that length(df1$A) = 100 and I have
df2 with a slot A so that length(df2$A)=200 then I
2012 Jan 18
4
R-Help
I am trying to create a frequency distribution and I am a bit confused.
Here are the commands I have entered:
> data <- read.csv(file="40609_sortedfinal.csv",head=TRUE,sep=",")
> NumberOfActionsByStatus = data$STATUS
> NumberOfActionsByUser = data$ETS_LOGIN
> NumberOfBidOffer = data$BID_OFFER
> NumberOfActionsByUser.freq = table(NumberOfActionsByUser)
>
2008 Jun 30
4
Rebuild of kernel 2.6.9-67.0.20.EL failure
Hello list.
I'm trying to rebuild the 2.6.9.67.0.20.EL kernel, but it fails even without
modifications.
How did I try it?
Created a (non-root) build environment (not a mock )
Installed the kernel.scr.rpm and did a
rpmbuild -ba --target=`uname -m` kernel-2.6.spec 2> prep-err.log | tee
prep-out.log
The build failed at the end:
Processing files: kernel-xenU-devel-2.6.9-67.0.20.EL
Checking