Displaying 20 results from an estimated 700 matches similar to: "strsplit"
2007 Aug 07
5
small sample techniques
If my sample size is small is there a particular switch option that I need to use with t.test so that it calculates the t ratio correctly?
Here is a dummy example?
รก =0.05
Mean pain reduction for A =27; B =31 and SD are SDA=9 SDB=12
drgA.p<-rnorm(5,27,9);
drgB.p<-rnorm(5,31,12)
t.test(drgA.p,drgB.p) # what do I need to give as additional parameter here?
I can do it manually but
2007 Oct 04
5
combining vectors on unequal length
If I have two vectors
X<-1:10
Y<-1:5
When I combine them using cbind, the shorter one is repeated and both are made of the same length. Is there a methods that does this without duplicating the shorter one. I want to use this to store the data back to a file.
Thanks ../Murli
[[alternative HTML version deleted]]
2009 Jul 14
4
Trig functions strange results
I am trying to calculate coordinate transformations and in the process of debugging my code using debug I found the following
Browse[1]> direction[i]
[1] -1.570796
Browse[1]> cos(direction[i])
[1] 6.123032e-17
Browse[1]> cos(-1.570796)
[1] 3.267949e-07
Browse[1]> direction[i]
[1] -1.570796
Browse[1]> cos(direction[i])
[1] 6.123032e-17
Browse[1]> cos(-1.570796)
[1] 3.267949e-07
2007 Jul 27
2
manipulating arrays
Can I insert an element in an array at a particular position without
destroying the already existing element?
X<-c(1,2,3,4,5)
I want to insert an element between 1 and 2.
Thanks ../Murli
[[alternative HTML version deleted]]
2009 Jul 24
2
computing the radius of an arc
Hi!!
I am interesting in computing the radius of an arc that best approximates a curve. Is there an R function that I can use to draw an arc?
Nothing useful came up when I searched help.search. Does anyone have any suggestion to do this?
Thanks ../Murli
2007 Sep 14
3
x-axis order
Hi all,
I have a time series which contain data collected weekly from week 26
to week 25 the following year. How do I plot this data, so that the
x-axis is displaying the week numbers, ordered as in the data?
Thanks in advance,
Gustaf
---
x<-c(26:52,1:25)
y<-rnorm(52)+1:52
plot(x,y) ## How do I get the x axis to be ordered by the current
ordering of x?
--
Gustaf Rydevik, M.Sci.
tel:
2007 Jun 26
3
inter-rater agreement index kappa
Is there a function that calculates the inter-rater agreement index
(kappa) in R?
Thanks ../Murli
[[alternative HTML version deleted]]
2008 Jun 25
1
stringdot
Hi!!
I am trying to figure out how to use the string kernel "stringdot" in kernlab.
k <- function(x,y) {
(sum(x*y) +1)*exp(-0.001*sum((x-y)^2))
}
class(k) <- "kernel"
data(promotergene)
## train svm using custom kernel
gene.k <- ksvm(Class~.,data=promotergene,kernel=k,C=10,cross=5) # works fine in this case
gene.rbf <-
2006 Sep 06
2
biplot label size
Which is the parameter that is used to decrease the size of ylabs
plotted in biplot? I tried playing with cex and cex.lab I am not getting
it right
pc <- princomp(USArrests)
biplot(pc, xlabs = rep("", nrow(USArrests)),ylabs=(colnames(USArrests)))
Thanks../Murli
[[alternative HTML version deleted]]
2007 Mar 18
1
multcomp
I used the multcomp package sometime back for doing multiple
comparisons. I see that it has been updated and the methods like simint
are no longer supported. When I run the program it prompts to me to use
glht. How do I get the lower and upper conf int and the pValues using
glht? Does anyone have an example?
Thanks ../Murli
[[alternative HTML version deleted]]
2006 Sep 07
1
labeling graphs
I am trying to add text at specific location on my graph. I know this
can be done in R but I can't recollect.
I was trying using locator() to identify the position and use identify()
but I can get it to work. Can someone jog my memory?
Thanks ../Murli
[[alternative HTML version deleted]]
2007 Mar 13
1
Rcmd and memory
I am running a recursive feature selection wrapper on svm for a large
data set. The routine gets progressively slower. I am deleting the
objects not required. Is there anything else you advise me look for?
I tried running it from the command line but it does not print anything
on the screen. I did not specify any output file and was expecting the
screen to be the default. Can any one help me
2008 Feb 06
1
filling data into objects
I am trying to generate artificial data for feature selection. Basically trying to generate a total of 1000 features with 100 that are informative and rest are uninformative.
Informative.data.class1<-rnorm(100,0.25,1)
Uninformative.data.class1<-rnorm(900,0,1)
Informative.data.class2<-rnorm(100, -0.25,1)
Uninformative.data.class2<-rnorm(900,0,1)
The above will give me one set of data
2008 Jun 04
1
dotchart
I am trying to plot the following data using dotchart
intersect.data<-structure(list(X = structure(c(1L, 3L, 8L, 9L, 10L, 11L, 12L,
13L, 14L, 15L, 2L, 4L, 5L, 6L, 7L), .Label = c("1-100", "1001-1100",
"101-200", "1101-1200", "1201-1300", "1301-1400", "1401-1500",
"201-300", "301-400", "401-500",
2009 Sep 23
1
dotchart to barplots
Hi,
I am trying to plot the following data so that it can be visually represented well. I tried the dotchart but I felt it was too spread out. Then I tried the barplot which is good enough for me. Is there a way to give the labels for the y-axis as in the dot chart? Also, I feel the grey level is confusing, so is there options for designs within the bars? I cannot use color as the journal wants
2009 Jul 15
1
Matrix multiplication precision
Hi!!
I am trying to multiply 5 matrices and then using the inverse of that matrix for further computation. I read about precision problems from the archives and the suggestion was to use as.numeric while computing the products. I am still having problems with the results. Here is how I am using it
#Mn.mat<-(T.mat %*% Rz.mat %*% Q.mat %*% Rz.mat %*% T.mat) # I was doing this in one step
2006 Sep 01
3
histograms
I am interested in plotting histograms for the following data
Isoform
Tumor_65_198
Tumor_50_192
Tumor_80_167
Tumor_80_204
Tumor_95_197
Tumor_70_189
Tumor_90_202
Tumor_40_177
Tumor_60_21
Tumor_70_174
Tumor_70_147
Tumor_50_5
ABCC4-2007
1
1
1
6
1
9
10
1
2
0
10
1
ABCC4-2008
5
8
7
5
3
10
5
5
7
3
10
3
ABCC4-2009
0
0
0
0
0
0
0
0
0
0
0
0
ABCC4-2010
2006 Jul 24
1
Saving R objects
I am trying to find the best way to save the follwoing object I am creating
library(multcomp)
data(recovery)
Dcirec<-simint(minutes~blanket, data=recovery, conf.level=0.9, alternative="less")
I am probably not doing it the most efficient way I think.
Here is what I am doing
a<-print(Dcirec)
write(a,file="mult_test.dat", append=T)
or
save(Dcirec,
2008 Sep 16
1
boxplot labelling levels
I want the levels to appear in the boxplot instead of 1 and 2. What do I need to do for that? Here is the dummy code.
x<-runif(100,50,80)
x1<-runif(100,70,80)
True.positives<-c(x,x1)
splice<-factor(c(rep("Human.AA.200",100),rep("Human.AA.100",100)))
splice<-factor(splice,levels=c("Human.AA.200","Human.AA.100"))
2003 Aug 13
1
The desire for prettier and cheaper images ...
This might be easy (but I didn't find an answer in the archives).
I'm trying to make nice looking images (using image()).
To make them look nice (not jagged), it usually takes me at least 100x100 points. This can be slow for frequent redraws.
Is there a smarter (less point intensive) way?
I was thinking in terms of hexabins, for example, which for much less jagged looking regions,