Displaying 13 results from an estimated 13 matches for "wgu".
Did you mean:
gu
2011 Apr 08
3
a strange behavior with ifelse
I have used R for years but run into a seemingly simple problem involving 'ifelse'. condensed code like this
a=c(2,NA,NA,NA,2,2,NA,2,NA,2)
b=c(NA,1,1,NA,2,2,2,2,2,2)
#I want to combined a and b into c so that c would be a valid number either a or b is not missing
c=ifelse(a==1|b==1,1,ifelse(a==2|b==2,2,NA))
cbind(a,b,c)
a b c
[1,] 2 NA NA
[2,] NA 1 1
[3,] NA 1 1
2008 Feb 12
2
how to specify modes of certain fields in read.table
...137
640879.6 3607116
640683.5 3607105
My question is how to specify these two columns in read.table. Maybe
colClasses helps but I have 50 columns...
Thanks
Weidong Gu,
Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294
Email: wgu@uab.edu
PH: (205)-975-9053
[[alternative HTML version deleted]]
2008 Feb 11
2
how to generate a column based on other columns in a data frame
...f
'site' based on the coordinates of samples so that samples from the same
sites have the same site ID like S1, S2,....
How to do this in R way? Thanks.
Weidong Gu,
Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294
Email: wgu@uab.edu
PH: (205)-975-9053
[[alternative HTML version deleted]]
2009 Feb 25
2
run latent class analysis with R
...best approach to running latent class analysis with R? I've downloaded both randomLCA and poLCA packages, but I am interesting in running a standard LCA with individual records (not frequency table) as input data.
Wen Gu
John Jay College of Criminal Justice445 West 59 StreetNew York, NY 10029
wgu@gc.cuny.edu
_________________________________________________________________
50F681DAD532637!7540.entry?ocid=TXT_TAGLM_WL_t2_ugc_post_022009
[[alternative HTML version deleted]]
2008 Feb 08
4
how to extract characters from a character string
Hi, I ran into a problem when I complied a dataset with UTM coordinates.
For calculating distances between sites, I need to reformat the
coordinates from, for example,
32?35.421 N, to 35.421, i.e. I need to delete all digits before symbol ?
and a space and N at the end of the string. What functions I should use?
Thanks in advance.
Weidong Gu,
Department of Medicine
University of
2008 Sep 07
1
run optim() on a list
...#But it gives an estimation based on the full data, not separately on
sp[[1]], sp[[2]],... I tried do.call without success. So, your help
would be appreciated.
Weidong Gu
Department of Medicine
University of Alabama, Birmingham
1900 University Blvd., Birmingham, Alabama 35294
Email: wgu@uab.edu
PH: (205)-975-9053
Site Pool Positivity
UBA_1
22
0
UBA_1
50
0
UBA_1
23
0
UBA_1
25
0
UBA_1
35
0
UBA_1
24
0
UBA_1
26
0
Cham_res
43
0
Cham_res
45
0
Cham_res
34
0
Cham_res
24
0
Cham_res
21
0
Cham_res
16
0
Cham_res
28
0
Cham_res
50
0
Cha...
2008 Jan 07
1
How to rearrange lattice graphics output?
My question arises when I use levelplot graphics. For example,
levelplot(z~x*y|fg) where fg is a factor with three levels of
'a','b','c'. The panels come out in a default order. I would like to
rearrange the panels in a manner of 'c','b','a'. I used
fg<-ordered(fg, levels=c('c','b','a'))
But the panels are still the
2008 Mar 27
1
panel function question
I have two data sets with locations, X, Y of houses (df.house) and
habitats(df.habitat), respectively. In each dataset, there are 3
replicates (Repeat). Because each replicate has different locations of
houses and habitats, I would like to plot them in panels. I wrote
something like this:
mypanel<-function(x,y,subscripts,...){
panel.xyplot(x,y,pch=20)
panel.xyplot(
2009 Mar 25
1
how to calcualte Jaccard Coefficient
Does anyone have a good method for calculating Jaccard coefficients now that the dissimilarity() function is no longer an option?
Wen Gu
John Jay College of Criminal Justice445 West 59 StreetNew York, NY 10029
wgu@gc.cuny.edu
_________________________________________________________________
Express your personality in color! Preview and select themes for HotmailĀ®.
GTX_WL_HM_express_032009#colortheme
[[alternative HTML version deleted]]
2008 Jan 31
1
decrease amount of ticks on y axis in lattice levelplot
Hi all,
How can I decrease the number of ticks on the y-axis in a lattice
levelplot()? I have as many ticks displayed on the y-axis as I have
columns of data (1000 columns), how can I decrease this amount of ticks,
while still properly displaying all the data?
Note that I get my data from a matrix object, in which the z-values of
the levelplot are the actual values in the matrix, whereas the
2010 Feb 05
0
how to draw two series in bwplot
Hi,
I have two numeric columns (dat1 and dat2) to bwplot
data=expand.grid(dat1=rnorm(20,10,5),class=1:5,school=letters[1:3]))
data$dat2=rnorm(300,13,6)
What I want is to plot two boxes side by side for class,
bwplot((dat1+dat2)~as.factor(class)|school,data=data)
but the code does not work this way, instead it plots addtions of the two columns. I changed allow.multiple with no success.
Your
2009 Feb 25
1
problems with arrangement of figures by layout function
Hi,
I want to have histograms behind the regression tree figure.
Since 7 leafs resulted from the tree model (rpart), it would be nice to
have correspondent histograms below the tree figure. After a little
study, I could generate the correspondent histogram for each leaf, but
can't figure out how to arrange them in the right place. I tried
something like
2009 Feb 23
1
why results from regression tree (rpart) are totally inconsistent with ordinary regression
Hi,
In my analysis of impacts of insecticide-treated bednets on malaria, I
look at the relationship between malaria incidence and mosquito
behaviors. The condensed data set is copied here. Ordinary regression
(lm) shows that Incidence was negatively related to Mortality. This
makes sense because the latter reflected the strength of killing
mosquitoes by insecticide-treated nets. Since the