Displaying 3 results from an estimated 3 matches for "indc".
Did you mean:
inc
2006 Feb 08
1
adding variable into dataframe by indice
...sample( c("(1,1)","(1,2)","(2,2)"),14,replace = T),
first_drink = sample(5:17,14,replace = T))
asubs112 <- subset(age.int, rs1042364 != "(2,2)")
ages112 <- sort(unique(na.omit(asubs112$first_drink)))
for ( i in ages112) {
indce <- which(na.omit(asubs112$first_drink == i))
prop <- length(indce)/nrow(asubs112)
asubs112[indce,4] <- prop
asubs112[indce,]
}
Below is the output that I get from the script above. Notice the proportion for the first NA but not any of the others. Not sure what I am doi...
2006 Feb 08
0
insert value according to indice
...that I am using to create this dataframe.
#Read in Data
age.int <- read.csv('C:/intage.csv',header = TRUE)
asubs112 <- subset(age.int, rs1042364 != "(2,2)")
ages112 <- sort(unique(na.omit(asubs112$first_drink)))
for ( i in ages112) {
indce <- which(na.omit(asubs112$first_drink == i))
prop <- length(indce)/nrow(asubs112)
asubs112[indce,5] <- prop
asubs112[indce,]
}
Below is the output that I get from the script above. Notice the proportion for the first NA but not any of the others. Not sure what I am doi...
2010 May 20
1
sqldf: issues with natural joins
...me(Tid = Tid[1:3], dfName = 'c')
# then use the sqldf library
> library(sqldf)
> sqldf()
# to create indices on the Tid variable shared across data.frames
> sqldf('create index indA on A(Tid)')
> sqldf('create index indB on B(Tid)')
> sqldf('create index indC on C(Tid)')
# check to make sure everything is there
> sqldf('select * from sqlite_master')
# doing a natural join (implicitly on Tid)
# does not give the expected joins
> sqldf('select * from main.A natural join main.B')
[1] Tid dfName
<0 rows> (or 0-length row...