On Tue, Nov 9, 2010 at 9:09 PM, wrote:
>
> Hi All,
>
> Suppose I want to concatenate a zero to all the values to a column called
> period in data frame A. I want to do the following but the following
> command actually deletes the entire column altogether.
>
> A$period<-cat(A$period,"0",sep="");
On Wed, Nov 10, 2010 at 1:38 PM, wrote:
>
> Greetings
> I'm attempting to insert missing data on the smallest size class of
> cave cricket instars into a data frame. The data involve censusing
> photoplots (plots) of roosting cave crickets in which we discern in four
> instars or size classes
On Thu, Nov 11, 2010 at 11:33 AM, Noah Silverman
wrote:
> Still doesn't work.
>
> When using rbind to build the data.frame, it get a structure mostly full of
> NA.
> The data is correct, so something about pushing into the data.frame is
> breaking.
>
> Example code:
> results <- data.frame()
>
> f
On Thu, Nov 11, 2010 at 1:19 PM, William Dunlap wrote:
> Peter,
>
> Your example doesn't work for me unless I
> set options(stringsAsFactors=TRUE) first.
> (If I do set that, then all columns of 'results'
> have class "character", which I doubt the user
> wants.)
You probably mean stringsAsFactor
On Thu, Nov 11, 2010 at 1:19 PM, William Dunlap wrote:
> Peter,
>
> Your example doesn't work for me unless I
> set options(stringsAsFactors=TRUE) first.
Yes, you need to set options(stringsAsFactors=FALSE) (note the FALSE).
I do it always so I forgot about that, sorry.
_
I see 4 ways to write the code:
1. make the frame very long at the start and use my code - this is
practical if you know that your data frame will not be longer than a
certain number of rows, be it a million;
2a. use something like
result1 = data.frame(a=a, b=b, c=c, d=d)
within the loop to cre
You change x from a single value to a vector of size 2, for example here:
if (j==2) {x=x+c(-1,1)*0.5}
That makes
c( qchisq(1-alpha/2,df=2*x)/2,
qchisq(alpha/2,df=2*x+2)/2)
a vector of 4 numbers that you are trying to assign to a row of a
matrix with two columns.
Not sure if there's a pre-defined function for it, but use your basic
math skills: the normal distribution is
dnorm(x) = 1/(sqrt(2*pi)) * exp(-x^2/2),
so the inverse function (on the interval [0, infinity] is
f = function(x) {sqrt( -2*log(sqrt(2*pi) * x)) }
Since the dnorm function is not 1-to-
On Sat, Nov 13, 2010 at 10:33 PM, Stephen Liu wrote:
> Win 7 64 bit
> R version 2.11.1 (2010-05-31)
>
>
> How to permanently remove;
> [Previously saved workspace restored]
>
>> rm (list = ls( ))
>
> On next start it still displays;
> .
> [Previously saved workspace restored]
>
>
> There is a
On Mon, Nov 15, 2010 at 2:07 PM, rchowdhury wrote:
>
> Hello,
>
> I am using the hclust function to cluster some data. I have two separate
> files with the same data. The only difference is the order of the data in
> the file. For some reason, when I run the two files through the hclust
> funct
On Mon, Nov 15, 2010 at 2:19 PM, Reshmi Chowdhury
wrote:
> Here is the code I am using:
>
> m <- read.csv("data_unsorted.csv",header=TRUE)
> m <- na.omit(m)
> cs <- hclust(dist(t(m),method="euclidean"),method="complete")
> ds <- as.dendrogram(cs)
As Christian said, you may want to plot the cs tre
On Tue, Nov 16, 2010 at 9:40 AM, Jeff Bassett wrote:
> Giovanni,
>
> Both matrices describing the points (A and B in my example) are the
> same size, so the resulting matrix will always be square. Also, the
> equation I'm using is essentially the following identity:
>
> Var(A + B) = Var(A) + Var(
> Peter,
>
> I see your point. As it turns out though, what I'm trying to
> calculate is heritability using a slightly modified version of an
> equation from multivariate quantitative genetics. Theoretically I
> suppose a heritability matrix could be non-positive definite, but in
> practice it al
On Fri, Nov 26, 2010 at 6:55 AM, Derik Burgert wrote:
> Dear list,
>
> running a hierachical cluster analysis I want to define a number of objects
> that build a cluster already. In other words: I want to force some of the
> cases to be in the same cluster from the start of the algorithm.
>
> An
Hi all,
I'm curious whether the standard correlation calculation implemented
in stats::cor uses the underlying BLAS (at least in the default case
use = "all.obs").
On a 32-bit linux system using R-2.11.1 compiled with GotoBLAS,
stats::cor is as fast as matrix multiplication, so it would appear
st
On Mon, Dec 13, 2010 at 4:33 PM, Joshua Wiley wrote:
> Hi All,
>
> I am trying to compile R 2.13.0 r53834 on 64-bit Windows 7 (home
> premium) using Rtools212.exe from Duncan Murdoch's site. I (think) I
> followed the installation guide for Windows. When installing Rtools,
> made sure I was inst
On Thu, Dec 16, 2010 at 7:00 PM, Dario Strbenac
wrote:
> Hello,
>
> Is it possible to call a graphing function that uses layout() multiple times
> and layout those outputs ? Here's a minimal example :
>
> myplot <- function()
> {
> layout(matrix(1:2, nrow=1), widths = c(1, 1))
> plo
On Mon, Dec 20, 2010 at 11:04 AM, cory n wrote:
>> length(sample(25000, 25000*(1-.55)))
> [1] 11249
>
>> 25000*(1-.55)
> [1] 11250
>
>> length(sample(25000, 11250))
> [1] 11250
>
>> length(sample(25000, 25000*.45))
> [1] 11250
>
> So the question is, why do I get 11249 out of the first command and
On Mon, Dec 20, 2010 at 12:48 PM, Chiquoine, Ben wrote:
> Hi,
>
> As will soon be very clear I'm an R novice. I'm trying to better understand
> the ks.test function in the stats package. When I look at the source code
> there are several calls to C functions (for example .C("pkstwo",
> is.int
There are several ways to get a matrix, for example
mat = as.matrix(as.data.frame(splitIDs))
or
mat = sapply(splitIDs, I)
True experts may suggests even more ways.
Peter
On Wed, Dec 22, 2010 at 1:02 PM, maddox wrote:
>
> Dear Guru's
>
> My first steps with R have ground to a halt! I have a v
see function levels()
?levels
Peter
On Wed, Dec 22, 2010 at 3:00 PM, maddox wrote:
>
> Hi,
>
> I have a factor with 3 levels. I'd like to recover the names of each level
> so I can use them to search through another data structure. Is this
> possible?
>
> Thanks
>
_
Hello,
a user of one of my packages has sent me the following problem that
apparently appears when loading the tcltk package. I'm guessing something
(Tcl/Tk? R open scripting framework?) is not installed correctly... can
someone please confirm or correct my guess? The OS is Mac 10.6.5.
Thanks,
P
On Mon, Jan 3, 2011 at 3:48 PM, Hadley Wickham wrote:
> Hi Frank,
>
> I think you mean packagename::functionname? The three colon form is
> for accessing non-exported objects.
Normally two colons suffice, but within a package you need three to
access exported but un-imported objects :)
Peter
_
Well, I'm pretty sure that, inside package A, calling B::functionName
will not work if B has not been imported. That's why I use ::: (after
spending some time trying to figure out why :: didn't work). At least
that was the state of affairs as of R 2.9 or so, perhaps things have
changed since then.
On Tue, Jan 4, 2011 at 4:02 PM, Murray Jorgensen
wrote:
> I'm going to try my hand at converting some Fortran programs to R. Does
> anyone know of any good articles giving hints at such tasks? I will post a
> selective summary of my gleanings.
If the code uses functions/subroutines, keep in mind
On Wed, Jan 5, 2011 at 7:35 PM, Eduardo de Oliveira Horta
wrote:
> Something like this:
>
> u=seq(from=-pi, to=pi, length=1000)
> f=sin(u)
> Cairo("example.pdf", type="pdf",width=12,height=12,units="cm",dpi=300)
> par(cex.axis=.6,col.axis="grey",ann=FALSE, lwd=.25,bty="n", las=1, tcl=-.2,
> mgp=c(
Several possibilities:
if (length(teams)!=length(unique(teams)) stop("Some teams are duplicated")
or
if (max(table(teams))>1) stop("Some teams are duplicated")
I'm sure there are others, too.
On Thu, Jan 6, 2011 at 12:21 PM, ADias wrote:
>
> Hi,
>
> I am with a problem on how to do a compar
>From a purely statistical and maybe somewhat naive point of view,
published p-values should be corrected for the multiple testing that
is effectively happening because of the large number of published
studies. My experience is also that people will often try several
statistical methods to get the
I'm guessing that your code actually generates two plots, one with the
command p <- plot(hc) and one with plot(p), which doesn't work for a
png. Try getting rid of the plot(p).
Peter
On Tue, Jan 11, 2011 at 4:01 PM, Richard Vlasimsky
wrote:
>
> Has anyone successfully created a PNG file for a de
I think you want the following, assuming you defined your function g():
gValues = apply(S, 1, g);
Sordered = S[order(gValues), ]
Peter
On Fri, Jan 21, 2011 at 11:38 AM, Francesco Petrogalli
wrote:
> Hi,
> is there a R function that order a matrix according to some criteria
> based on the rows(
On Mon, Jan 24, 2011 at 2:47 PM, Yanika Borg wrote:
> I am using the function permutations from the package *gregmisc*. However, I
> am also making use of the package *e1071*, which also contains a function
> called permutations. I want to use the function permutations from the *
> gregmisc* packa
On Tue, Apr 26, 2011 at 2:28 PM, Val wrote:
> Hi all,
>
> Assume I have a matrix
> xv= [1 0 0 0 0 12,
> 0 1 0 0 0 10,
> * 0 0 1 0 0 -9,*
> 0 0 0 1 0 20,
> * 0 0 0 0 1 -5]*
>
> if the last column of "xv" less than 0 then I want to set zero the entire
> row.
> The desired output
On Sun, May 8, 2011 at 4:41 PM, Worik R wrote:
> Friends
>
> I am trying to format a number to a string so 2189.745 goes to "2,189.35"
> and 309283.929 goes to "309,283.93"
>
> I have tried to use formatC(X, big.mark=",",drop0trailing=FALSE, format="f")
> but it does not get the number of decimals
On Wed, May 11, 2011 at 10:12 AM, rna seq wrote:
> Hello List,
>
> I am trying to implement a hierarchical cluster using the hclust method
> agglomerative single linkage method with a small wrinkle. I would like to
> cluster a set of numbers on a number line only if they are within a distance
> of
On Wed, May 18, 2011 at 7:41 AM, Meng Wu wrote:
> Hi, all
>
> I would like to use R to perform k-means clustering on my data which
> included 33 samples measured with ~1000 variables. I have already used
> kmeans package for this analysis, and showed that there are 4 clusters in my
> data. Howeve
On Thu, May 19, 2011 at 7:21 PM, karena wrote:
> Hi, I have a question about how to do covariate adjustment.
>
> I have two sets of 'gene expression' data. They are from two different
> tissue types, 'liver' and 'brain', respectively.
> The purpose of my analysis is to compare the pattern of the w
On Thu, May 19, 2011 at 10:58 PM, karena wrote:
> Thank you so much for this reply, Peter. It helps.
>
> I know this is one way to adjust for covariates. However, if what I want is
> to get the 'remaining values' after adjustment. For example, say, 'gene
> expression' value is denoted as 'ge', and
On Tue, May 24, 2011 at 3:18 PM, Unger, Rachel
wrote:
> I'm analyzing data using Random Forest Regression. For some of the
> species I am analyzing, the percent variation explained is negative.
> Could you please explain to me what that means? If you need more
> information, please let me know.
On Thu, May 26, 2011 at 10:03 AM, StatBat2
wrote:
> Hello!
>
> I am trying import data into R and im running into a snag.
>
> GOAL:
> Import a 4 column, 8,000 row table into R including headers.
>
> WHAT I'VE ATTEMPTED:
> Original data was in Excel format.
> Converted data to both a .txt and .csv
On Sun, May 29, 2011 at 11:53 PM, wrote:
> There is an urban legend that says Indiana passed a law implying pi = 3.
>
> (Because it says so in the bible...)
>
Apparently the Fortran language has a DATA statement just for this
purpose. This is allegedly a quote from an early Fortran manual:
The
The WGCNA package contains function corAndPvalue that will calculate
the correlation and the associated p-values for two matrices more
efficiently and quickly.
HTH,
Peter
On Tue, May 31, 2011 at 12:03 AM, Unger, Kristian, Dr.
wrote:
> Hi there,
>
> I wonder if there is a way of efficiently gene
I observed the same behaviour some time ago. The .Rd files are
pre-processed using a latex-like typesetter that discards everything
following a % sign as comments, even in example R code.
http://r.789695.n4.nabble.com/Rd-file-processing-suggestion-sign-in-examples-td3459570.html
HTH,
Peter
On
On Tue, May 31, 2011 at 2:19 PM, David Doyle wrote:
> I often have data sets that have nondetects in them. For example
> Result Detected ( 0=No 1=Yes)
> 14 1
> 20 1
> 10 0
> 19 1
> 12 0
> 9 1
> 15
On Thu, Jun 2, 2011 at 3:13 PM, Rolf Turner wrote:
> On 03/06/11 09:03, Walmes Zeviani wrote:
>>
>> Hello list,
>>
>> I have plots with long strings in main=, ylab= or xlab=. So, in I my
>> script
>> I use break long lines to avoid lines hiden on my monitor and in sweave
>> document pages. I use g
> Absolutely not! Did you *read* the OP's question? He wants to break
> the line in the code --- for readable code presumably --- but ***not***
> in the output! Your advice is the antithesis of what is required.
>
> cheers,
>
> Rolf Turner
I stand corrected, indeed I missed the cruci
On Mon, Jun 13, 2011 at 8:48 AM, Lee, Eric wrote:
> Hello,
>
> I'm running version R x64 v2.12.2 on a 64bit windows 7 PC. I'm trying to
> read a text file using read.table where the values have a format like
> "1,234,567". What I want is "1234567". Is there a quick way to strip out
> the com
Hi all,
apologies if this has been answered before, I didn't find the answer
in the archives. I am putting together a package that I would like to
have optional functionality if another package is installed. In
normal, non-package code, I would simply write something like
if (require(qvalue))
{
If you didn't specify an external BLAS when you ran R configure
script, you are not using ATLAS. If you're not sure and you still have
the output of the configure script, at the end it'll say whether it
uses an external BLAS.
Alternatively, you may also want to generate two random 5000x5000
matric
c concatenates all arguments. For example, c(c(0,1,2), c(3,4,5)) gives
a vector 0,1,2,3,4,5.
Another example:
> c(list(a=c(0,1), b = c(2,3)), list(c = c(4,5), d = c(5,6)))
$a
[1] 0 1
$b
[1] 2 3
$c
[1] 4 5
$d
[1] 5 6
So instead of a list of two lists, you get a single list with 4 components.
I
list_of_fits, fitJC1)
>
> # still works, from original list construction
> x[3]
>
> # but this doesn't work
> x[4]
>
> Cheers!
> Nick
>
>
>
> Peter Langfelder wrote:
>
>> c concatenates all arguments. For example, c(c(0,1,2), c(3,4,5)) gives
>> a
t;
> I did notice during the VERY long compilation that it seemed to
> correctly identify that I have 4 CPUs.
>
> Can someone confirm that the test:
>
> a = matrix(rnorm(5000*5000), 5000, 5000)
> b = matrix(rnorm(5000*5000), 5000, 5000)
> c = a%*%b
>
> Should illicit a multi-
On Thu, May 27, 2010 at 9:43 AM, William Dunlap wrote:
>> -Original Message-
>> Unlike with vectors, with lists you don't have to specify
>> length and can add
>> as many list components as you want later The length of the list will
>> automatically adjust.
>
> 'Nonrecursive' vectors (i.e
temp2 = tempr
temp2[temp2<0] = 0
HTH
On Fri, May 28, 2010 at 8:37 AM, wrote:
> I have a data frame with both positive and negative values, and I want to
> make all the negative values equal zero, so i can eventually take an
> average.
> I've tried
> temp2 <- ifelse(tempr<0, 0, tempr)
> but it
Well, your example matrix is symmetric, so row and column operations
naturally return the same values.
You may want to note though that if you apply your function to a matrix
along rows, the results will be stored in the __columns__ of the resulting
matrix. Thus, if you want to simply divide the r
On Fri, Jun 4, 2010 at 1:44 PM, Ben Bolker wrote:
> Eduardo J. Chica gmail.com> writes:
>> Hi I am having problems with the rendering of scientific symbols (mu and
>> degree) in my plots. Whenever I use these symbols they are rendered
>> changed (mu is changed to the proportionality symbol and de
>
> This issue is already in the Notes section of ?pdf. It remains to be seen
> if the OP's problem was this exact one, since they didn't specify an
> example.
aahhh, thank you for pointing this out. I never noticed this note.
Peter
__
R-help@r-projec
c(as.matrix(data)) will not do it?
Peter
On Fri, Jun 4, 2010 at 5:47 PM, Nick Matzke wrote:
> Hi,
>
> This can't be hard, but I can't find the solution. I have a 380x380 data
> frame of numbers. I would like to turn it into a single column so I can do
> e.g. hist and mean on it without writing
On Mon, Jun 7, 2010 at 9:05 AM, sidahmed BENABDERRAHMANE
wrote:
> Dear all,
>
> I have a problem when using some classification functions (Kmeans, PAM,
> FANNY...) with a distance matrix, and i would to understand how it proceeds
> for the positioning of centroids after one execution step.
>
> In
To get the counts, assuming your data frame is called factors and it only
contains the 17 factors, you can do
n = nrow(factors)
aux = rep(1, n);
tab = tapply(aux, as.list(factors), sum);
example:
factors = matrix(sample(c(1:3), 3000, replace = TRUE), 1000, 3)
lfactors = as.list(data.fran = nrow(
apply(iris[, -5], 2, tapply, iris$Species, mean)
On Wed, Jun 9, 2010 at 3:43 PM, SH.Chou wrote:
> Hi there:
> I have a question about generating mean value of a data.frame. Take
> iris data for example, if I have a data.frame looking like the following:
> -
>Sepal.Len
Here's a solution., maybe not the most elegant but works.
df.r = df1[, c(3:5)]; # restricted data
nNonZero = apply(df.r!=0, 1, sum);
one = nNonZero==1;
oneZero = nNonZero==2;
whichOne = apply(df.r[one, ]!=0, 1, which);
whichZero = apply(df.r[oneZero, ]==0, 1, which);
colNames = colnames(df.r);
On Mon, Jan 31, 2011 at 9:30 AM, Mike Miller wrote:
> Is there an R function for computing a variance-covariance matrix that
> guarantees that it will have no negative eigenvalues? In my case, there is
> a *lot* of missing data, especially for a subset of variables. I think my
> tactic will be t
On Wed, Feb 2, 2011 at 7:22 PM, Nick Matzke wrote:
> Oh wait, this basically does it:
>
>> if ("a" %in% attributes(z)$names)
> + print(TRUE)
> [1] TRUE
>
> (but there may be a better way)
If z is a list, you can test
is.null(z$a)
Peter
__
R-help@r-pr
Hi all,
I'm hoping someone more knowledgeable in Fortran than I can chime in
with opinion.
I'm the maintainer of the flashClust package that implements fast
hierarchical clustering. The fortran code fails when the number of
clustered objects is larger than about 46300. My guess is that this is
be
> This only helps to some extent.
>
> If you set I=N and J=N then with N somewhere between 113000 and 114000
> ioffset will turn negative.
Thanks to all for suggestions. N=113000 is by far out of range since
(as far as I can tell) the distance structure would be longer than R
can presently handle,
Here's an example:
x = c(1,2,3,4,5);
y = rnorm(5);
labels = LETTERS[1:5];
plot(x,y, type = "n") # This sets up the plot but doesn't actually
plot the points
text(x,y, labels) # This adds labels to positions (x,y)
HTH,
Peter
On Tue, Feb 8, 2011 at 12:42 PM, Schatzi wrote:
>
> I would like to
On Thu, Feb 10, 2011 at 8:45 AM, Simon Gillings wrote:
> I am using bagging to perform Bagged Regression Trees on count data (bird
> abundance in Britain and Ireland, in relation to climate and land cover
> variables). Predictions from the final model are visually believable but I
> would reall
On Tue, Feb 15, 2011 at 9:21 AM, Robert M. Flight wrote:
> Say I have a tab-delimited table I want to read into R. What should I
> expect to happen if some of the entries contain the character " ' "? I
> thought it would read the file fine, but that is not what happens.
> Instead, all the values i
On Tue, 15 Feb 2011, Stuart Jaffe wrote:
> Hi,
> I'm trying to write a file to a shared drive on a network. I use the
> "write.csv" function with the correct path but R doesn't recognize the
> directory. Is there something different I have to do since it's a shared
> drive?
> Thanks.
Check that
On Tue, Feb 15, 2011 at 11:56 AM, Kevin Wright wrote:
> The original poster did not say what operating system was being used. From
> my own experience on Windows, I always used "/" for reading from the local
> hard drive, but when I started working with Windows network shares/folders,
> I had to
On Tue, Feb 15, 2011 at 8:43 PM, Steven Cordwell wrote:
> Hi,
>
> I have a vectors x and z, for example,
>
> x <- 0:20
> z <- round(runif(20,1,7))
> y <- 0.5
>
> and I want to display z as an image. However if I then call image() with a
> vector
>
> image(x,y,t(z),zlim=c(1,7),col=heat.colors(7),x
Hi all,
tried to google but found nothing, so here goes the question: is there
a way to control line spacing when displaying text in graphical mode
(for example, using text())?
As an example, run the following code:
plot(c(0,1), c(0,1), type = "n", axes = FALSE, xlab = "", ylab = "")
text(0.5, 0
On Fri, Feb 18, 2011 at 3:55 PM, Sarah Goslee wrote:
> Peter,
>
> Try par()$lheight
>
> The catch is, you need to set it *before* the call to text()
>
> par(lheight=.8) # closer together
> text(x, y, "whatever\nsecondline")
>
> The best place to find options like lheight is in ?par
Thanks - I had
On Sat, Feb 19, 2011 at 6:17 PM, Søren Faurby
wrote:
> I wish to generate a vector of uniformly distributed data with a defined
> correlation to another vector
>
> The only function I have been able to find doing something similar is corgen
> from the library ecodist.
>
> The following code gener
On Thu, Feb 24, 2011 at 10:03 AM, Duke wrote:
> Hi folks,
>
> I am wondering if the following is possible: I want to control the arguments
> sent to a function by string variables. For example, instead of
>> heatmap.2( A, col=greenred(75) )
> I would want to have something like:
>> heatmap.2 ( pas
On Tue, Mar 1, 2011 at 1:36 PM, Tamas Barjak wrote:
> Help me please!
>
> I would like to be saved a data table:
>
> write.csv(random.t1, "place", dec=",", append = T, quote = FALSE, sep = " ",
> qmethod = "double", eol = "\n", row.names=F)
>
> It's OK!
>
> But the rows of file
> 1,1,21042,-4084
On Wed, Mar 2, 2011 at 6:31 AM, Bettina Kulle Andreassen
wrote:
> hi,
>
> i am getting an error when calling the impute.knn
> function (see the screenshot below).
> what is the problem here and how can it be solved?
>
>
> screenshot:
>
> ##
> *** caught segfault ***
> address 0x51
On Fri, Mar 4, 2011 at 8:02 AM, Arnaud Mosnier wrote:
> Dear all,
>
> Since I installed the x64 version of R (v2.12.1), I got a problem with tcltk
> that I did not achieve to resolve.
> When loading the library, it gives me the following error message:
>
> Loading Tcl/Tk interface ...Error : .onLo
On Mon, Mar 14, 2011 at 1:06 PM, Pavan G wrote:
> Hello All,
> I have a histogram with values above and below 0. I would like to color the
> +ve bars green and -ve bars red. I am plotting data using:
>
> hist(a[,2],breaks=100,main="W3",xlab="Movement towards site (A)")
>
> Can someone please comme
On Tue, Mar 15, 2011 at 1:17 PM, hihi wrote:
> Hi All,
> is there any effiective and dense/compact method to calculate the mean of a
> list of - of course coincident - matrices on an element by element basis? The
> resulting matrix' [i, j]-th element is the mean of the list's matrices' [i,
> j]
On Wed, Mar 16, 2011 at 8:28 AM, Feng Li wrote:
> Dear R,
>
> If I have remembered correctly, a square matrix is singular if and only if
> its determinant is zero. I am a bit confused by the following code error.
> Can someone give me a hint?
>
>> a <- matrix(c(1e20,1e2,1e3,1e3),2)
>> det(a)
> [1]
I think it is as simple as adding the argument fixed=TRUE to the function call.
txt = "this. is. a. test."
gsub(".", "", txt, fixed = TRUE)
result
[1] "this is a test"
HTH,
Peter
On Sun, Mar 20, 2011 at 9:49 PM, Sparks, John James wrote:
> Dear R Users,
>
> I am working with gsub for the firs
On Mon, Mar 21, 2011 at 8:34 AM, Vincy Pyne wrote:
> Dear R helpers,
>
> Suppose I have stock returns data of say 1500 companies each for say last 4
> years. Thus I have a matrix of dimension say 1000 * 1500 i.e. 1500 columns
> representing companies and 1000 rows of their returns.
>
> I need to
On Tue, Mar 22, 2011 at 11:35 AM, Unger, Kristian, Dr.
wrote:
> Hi there
>
> I recently got some affymetrix human gene 1.0 st array. I only get out the
> probe level data and I wonder if there is a function that is able to average
> the probe level data for each gene?
In the WGCNA package we ha
On Wed, Mar 23, 2011 at 1:17 PM, Michal Figurski
wrote:
> Dear R-helpers,
>
> This may sound simple to you, but I'm a beginner in this, so please be
> forgiving.
> I have a following problem: two analytes were measured in patient's blood on
> 4 occasions: ProteinA and ProteinB. How to correctly ev
On Fri, Mar 25, 2011 at 2:57 PM, wang peter wrote:
> i did clustering on a data with 497 rows and 71 columns
> but the result picture is too big to display
> how can i display it partly
> this is the code:
> x<-read.table("x",sep=",")
> dim(x)
> library(cluster)
> t<-agnes(x)
> par(ask=T)
> plot(
On Mon, Mar 28, 2011 at 6:36 PM, Benton, Paul
wrote:
> Benno,
>
> That helps but it only makes the color bar symmetrical. I want to be able to
> compare 2 different heatmaps so that 0.7 (for example) is always the same
> tone of green and not shifted slightly. Is this possible?
>
> Paul
>From w
On Wed, Mar 30, 2011 at 10:04 PM, Samuel Dennis wrote:
> I have a very large dataset with three variables that I need to graph using
> a scatterplot. However I find that the first variable gets masked by the
> other two, so the graph looks entirely different depending on the order of
> variables.
On Thu, Mar 31, 2011 at 11:48 AM, Hans Ekbrand wrote:
>
> The variables are unordered factors, stored as integers 1:9, where
>
> 1 means "Full-time employment"
> 2 means "Part-time employment"
> 3 means "Student"
> 4 means "Full-time self-employee"
> ...
>
> Does euclidean distances make sense on
On Thu, Mar 31, 2011 at 5:49 PM, array chip wrote:
> Thanks Bernd! I tried your approach with my real example, sometimes it worked,
> sometimes it didn't. For example
>
> grep('[^(arg)]\\.symptom',"stomach.symptom",value=T)
> [1] "stomach.symptom"
>
> grep('[^(arg)]\\.symptom',"liver.symptom",valu
On Wed, Apr 6, 2011 at 3:09 PM, Laura Smith wrote:
> Hi!
>
> In a function, I may have an instance in which all elements are equal.
>
>> x <- rep(1,5)
>>
>> x
> [1] 1 1 1 1 1
>> identical(x)
> Error in .Internal(identical(x, y, num.eq, single.NA, attrib.as.set)) :
> 'y' is missing
>> all.equal(x)
On Thu, Apr 7, 2011 at 5:32 PM, Rolf Turner wrote:
> On 08/04/11 12:22, Erik Iverson wrote:
>>
>> Rolf,
>>
>> What does
>>
>> > capabilities("tcltk")
>>
>> return?
>
> FALSE
>
As others have indicated, your R was compiled without Tcl/Tk support.
Most likely because Tcl/Tk was/is not installed o
On Sun, Apr 10, 2011 at 2:24 PM, Wendy wrote:
> Hi all,
>
> I have a huge matrix of TRUE/FALSE table like following, and I want to count
> the number of TRUEs in each row. Instead of looping through each row and do
> length(Z[Z==TRUE]), I am wondering if there is an easier way of doing this.
>
>
On Sat, Apr 9, 2011 at 10:24 AM, Sean Farris wrote:
> I am in need of someone's help in correlating gene expression. I'm somewhat
> new to R, and can't seem to find anyone local to help me with what I think
> is a simple problem.
>
> I need to obtain pearson and spearman correlation coefficients,
On Mon, Apr 11, 2011 at 10:49 PM, Erin Hodgess wrote:
> Dear R People:
>
> I have a data frame with the following column names:
>
>> names(funky)
> [1] "UHD.1" "UHD.2" "UHD.3" "UHD.4" "L..W..1" "L..W..2" "L..W..3"
> [8] "L..W..4" "B..W..1" "B..W..2" "B..W..3" "B..W..4" "W..B..1" "W..B..2
On Mon, Apr 18, 2011 at 9:12 AM, Jim Silverton wrote:
> I am using storey's qvalue package but I keep on getting errors. Why is
> this?
>
>> qvalue(p, lambda=0.5)$pi0
> [1] "ERROR: p-values not in valid range."
> Error in qvalue(p, lambda = 0.5)$pi0 :
> $ operator is invalid for atomic vectors
S
Hi folks,
I have come across a simple quirk that took me a long time to figure
out. The gist is that if I write, in the example section of an Rd
file, the line
c = a %*% b
what R will see when running the example is
c = a
since the % signs are apparently considered comment signs even in the
\e
You need to index the variable iter: instead of iter = x[i], say
iter[i] = x[i].
But a better solution is to simply say
iter = x
at the beginning and don't update it in the loop.
The way your code is written, iter just holds the last x[i], and the
last x[i] at the end of each loop is 4.
Peter
Hi all,
in my package I have a function with name plot.cor (this function is
inherited from another legacy package). According to CRAN package
checks reports, the check apparently thinks plot.cor is a method for
the plot generic (I hope I'm using the correct terminology).
checking Rd \usage secti
Sorry if this is a duplicate... my email is giving me trouble this evening...
On Tue, Aug 9, 2011 at 8:38 PM, Chris Howden
wrote:
> Hi,
>
> I’m trying to do a hierarchical cluster analysis in R with a Big Data set.
> I’m running into problems using the dist() function.
>
> I’ve been looking at a
201 - 300 of 413 matches
Mail list logo