Displaying 5 results from an estimated 5 matches for "myvariablenam".
Did you mean:
myvariablename
2011 Sep 13
3
x %>% y as an alternative to which( x > y)
...return(which(table > x))
}
"%<%" <- function(table, x) {
return(which(table < x))
}
test <- c(NA, 1:4,NA,5)
test %>% 2
# [1] 3 4 6
test %<% 2
# [1] 1
Why do I want to do this?
Because in coding, I often end up with big chunks looking like this:
((mydataframeName$myvariableName > 2 & !is.na(mydataframeName$myvariableName)) & (mydataframeName$myotherVariableName == "male" & !is.na(mydataframeName$myotherVariableName)))
Which is much less readable/maintainable/editable than
mydataframeName$myvariableName > 2 & mydataframeName$myotherVariab...
2007 Apr 26
4
select if + other questions
...ition1 length 5
PROV position 6 length 2
GRADE position 9 length 2
Y_Q10A position 33 length 1
Y_Q10A has the following 1=yes
2=no
9=skip
all the others have no skipped or missing values
Here is my code:
myfile<-("c:/test2.txt")
myVariableNames<-c("PUMFID","PROV","GRADE","Y_Q10A")
myVariableWidths<-c(5,2,2,1)
mydata<-read.fwf(
file=myfile,
width=myVariableWidths,
col.names=myVariableNames,
row.names="PUMFID",
fill=TRUE,
strip.white=TRUE)
print(mydata)
print( mydata [which(...
2007 Apr 27
5
weight
Hi,
I have the file below called happyguys. It is a subset of data. How do I
apply the weight variable (WTPP) to this file? Can i just multiply each
column (except the first column because it is a record id) by WTPP? If the
answer is yes, how do I multiply one variable name by another?
Thanks,
Nat
PROV REGION GRADE Y_Q10A WTPP
83 48 4 7 2 342233324020
115
2007 Apr 27
0
like SPSS
...eighted my file? or even the process that
SPSS is going through to aggregate the data?
Thanks,
Nat
Here is my code:
myfile<-("c:/test2.txt")
mysubset<-myfile
mysubset$Y_Q02 <-mysubset$DVSELF <-NULL
mysubset2<-mysubset
mysubset2$Y_Q10B <-mysubset2$GP2_07 <-NULL
myVariableNames<-c("PUMFID","PROV","REGION","GRADE","Y_Q10A","WTPP")
myVariableWidths<-c(5,2,1,2,1,12.4)
mysubset2<-read.fwf(
file=myfile,
width=myVariableWidths,
col.names=myVariableNames,
row.names="PUMFID",
fill=TRUE,
strip...
2007 Jul 24
7
Obtaining summary of frequencies of value occurrences for a variable in a multivariate dataset.
Hi all,
If the question below as been answered before I
apologize for the posting.
I would like to get the frequencies of occurrence of
all values in a given variable in a multivariate
dataset. In short for each variable (or field) a
summary of values contained with in a value:frequency
pair, there can be many such pairs for a given
variable. I would like to do the same for several such
variables.