Displaying 20 results from an estimated 2000 matches similar to: "string functions"
2010 Mar 08
1
compare tables
Hi!
I need some help to finish my script.
I have two tables that I combine randomly to produce a third table.
This I do for hundreds of iterations. In the output file I get all the
simulated tables after each other. It looks like this (in this case 3
iterations):
output file:
[[1]]
[,1] [,2] [,3]
[1,] "GM030005" "WI920024" "CCCC"
[2,]
2010 Jan 11
1
apply a function down each column
Hello World,
I have a function that makes pairwise comparisons between two strings. I would like to apply this function to my data (which consists of columns with different strings) in the way that it compares the first with the second entry, and then the third with the fourth, and then the fifth with the sixth, and so on down each column...
So (2x-1) and (2x) would be the different entries to be
2009 Jun 26
2
Indexing a list with a list
Dear list,
I have two lists: one with data and one with TRUE/FALSE values for data
I want to further analyze (see example below). I have been able to use a
for loop to extract the data that I want to keep, but think that there
probably exists a way to do it without a loop. Any ideas?
#sample data
set.seed(100)
example = list(letters[1:10], letters[1:10], letters[1:10])
ind =
2010 Apr 25
3
numerical or not?
Hi,
I've had a little problem for several weeks now. It is annoying and
therefore I will ask for help now:
When I write a script with several iterations, I make it write out a
text file to save the data during the run. For example I write:
if (i %% 25) write.table(output,"temporary_output.txt")
Later on, when I read in this output and want to calculate things, R
complains that
2010 Jan 05
2
Fast nested List->data.frame
I have very large data sets given in a format similar to d below. Converting
these to a data frame is a bottleneck in my application. My fastest version
is given below, but it look clumsy to me.
Any ideas?
Dieter
# -----------------------
len = 100000
d = replicate(len, list(pH = 3,marker = TRUE,position = "A"),FALSE)
# Data are given as d
# preallocate vectors
pH =rep(0,len)
marker
2009 Jul 08
2
Simple monovariate classification?
I'm looking for an R function that simply recodes a quantitative
variable into a number of classes according to specified break-points.
Obviously I can do this using nested ifelse() commands, but I want
to write it into a function where I can't pre-specify the number of
classes. Is there an obvious way to do this?
An example to clarify: how to convert c(0,10,5,1,9,6) to
2010 Aug 20
3
if-else function
Hi R people!
I am looking for some suggestions writing an if-else function.
The idea is to characterize different plots containing counts of
variables (here parasites). If a plot has a count equal or higher than
4 for any parasite the function should return a 1 else a 0. Later I
can loop the function over all plots.
Here I have a little subset of my data:
VariablePAR Plot1
2010 Aug 28
2
extracting columns
Hi,
Can anybody show me how to extract all columns in my dataset that are
polymorphic? Or phrased in another way I would like to delete all
columns that have no more than one letter in it (that are monomorphic).
Thank you.
Laetitia
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: seqCol.txt
URL:
2009 Dec 11
3
Correcting for missing data combinations
I can think of many brute-force ways to do this outside of R, but was
wondering if there was a simple/elegant solution within R instead.
I have a table that looks something like the following:
Factor1 Factor2 Value
A 11/11/2009 5
A 11/12/2009 4
B 11/11/2009 7
B 11/13/2009 8
>From that I need to generate all permutations of Factor1 and Factor2 and
force a 0 for any combination that doesn?t
2011 May 13
1
period in scale parameter of prcomp
Hi all,
Looking at the help file for prcomp and the code in
stats:::prcomp.default, the scale parameter for the default S3 method
has a trailing period: it written as
scale.
I assume there is a reason for it (backwards compatibility with S was
suggested) but I thought I'd ask.
Thanks,
Greg
--
Greg Hirson
ghirson at ucdavis.edu
Graduate Student
Agricultural and Environmental Chemistry
2010 May 19
1
sample and rearrange
Dear Wu Gong and Peter Ehlers,
thank you very much for your help debugging my script.
Now I have a general following up question:
Is there a straightforward way to rearrange the following dataset so
that all first letters of each column will be combined in one column,
all the second letters in a second column, all the third ones in a
third column and so on, resulting in 7 columns,
i.e. for
2009 Jul 10
2
to get the R-Squared value
Dear all,
I know there are 'coef', 'predict', 'fit' to get the corresponding
outputs. Is that possible to get the value of R-squared from a 'lm'
output?
Many thanks.
2009 Sep 08
1
Plotting two qqnorm plots:
Hi all,
Does anyone know how to plot overlapping qqnorm plots on the same window?
Suppose I have data in the vector x and y:
qqnorm(x)
lines(qqnorm(y))
I though these two lines will do the job... However, lines doesn't seem to
work. Anyways, thanks in advance!
--
View this message in context: http://www.nabble.com/Plotting-two-qqnorm-plots%3A-tp25352893p25352893.html
Sent from the R help
2010 Feb 18
1
Shapiro-Wilk test problem
Hi everybody,
Does anyone know what problem may be with this test.
I am applying 5 different normality tests and use p-values for them, but for
some reason S-W gives me NA, while sample size is 100.
Any ideas?
Thanks a lot!
[[alternative HTML version deleted]]
2011 May 16
1
help: Using hotelling for a confidence region for PCA scores
Hello everyone.
In my last post I did not explained my problem quite well. I made a principal component analysis and took the 2 first principal components. I made a chart of my points based on the score of the 2 PC. I would like to add on this graph a 95% confidence region. To do this I used the ellipse function as follows:
pcsref=PC$score[data[,1]==ref,1:2] #matrix containing the scores
2005 Jun 04
2
glm with a distribution free family
Dear R users,
I am trying to fit a glm with a distribution free family, link = log and variance = constant*mu. I guess I have to use the quasi family but the choices of variance are restricted to constant or mu or mu^2..., I don't know the way to choose the variance that I need, i.e. constant*mu.
If you have any ideas or advice, please tell me.
Thanks,
Laetitia Mestdagh
Laetitia Mestdagh
2010 Mar 18
5
can I rotate a matrix
useR's,
I want to be able to rotate a matrix 90 degrees, clockwise. For example,
> mat
[,1] [,2] [,3]
[,1] 1 2 1
[,2] 3 2 6
[,3] 4 5 3
I want to rotate it, so that it looks like this...
[,1] [,2] [,3]
[,1] 4 3 1
[,2] 5 2 2
[,3] 3 6 1
Does anyone know a quick and straightforward way to do this?
Thanks in advance.
--
View
2009 Aug 21
4
help with median for each row
Hi,
I tried looking through google search on whether there's a way to computer
the median for each row of a nxn matrix and return the medians for each row
for further computation.
And also if the number of columns in the matrix are even, how could I
specify which median to use?
Thank you very much!
--
Edward Chen
[[alternative HTML version deleted]]
2003 Apr 28
2
Algorithm did not converge
Help! Being a bit of a novice, please bear with me if this is a stupid
question!
I am trying to fit a saturated model to some count data that I have:
model<-glm(COUNT~SP*LOC*COL*TIME*TREAT,poisson)
but R keeps on crashing and coming up with (occasionally before crashing) an
error that states:
Algorithm did not converge in: (if(is.empty.model(mt)) glm.fit.null else
glm.fit)(x = X, y = Y,
2006 Feb 15
2
Setting intial path under windows to MyComputer in Interactive file browser
Hello everyone,
How can I specify in tcltk file browser the initial directory to
"MyComputer" in Windows where Drives and Partition are accessible?
And just a little question if anyone knows, is there a way to use the
function choose.files under windows to select a directory?
Thanks a lot for your help.
Laetitia.