Thanks Anupam for your inputs. I believe there are two ways to
circumvent the issue...1> making the code more efficient 1> Increasing
the memory in some way.The reasons why I did not paste the code are 1>
It is long and using quite a number of functions that I created 2>
Secondly my intention is n
That's great! But, I guess I should have provided a better example for
my problem. The reason being that I did not consider strings. For
instance, in my case, I'm actually trying to add a value to a data frame
that looks like this:
Obs X
0 NA
1 "01 001"
2 "01 002"
3 "01 003"
On Fri, 10 Jun 2011, Greg Snow wrote:
Tk windows run asynchronous to the rest of R, so you could write a
small function that lets you type the command into a Tk window and
runs it while you continue to work in the main R, then the window
could signal you when the function finishes.
That is r
Hi:
I couldn't find one by searching with RSiteSearch() or package sos,
but it's not hard to write a simple function that reproduces the
example on the Wikipedia page:
ndcg <- function(x) {
# x is a vector of relevance scores
ideal_x <- rev(sort(x))
DCG <- function(y) y[1] + sum(y[-1]/log(2
You may want to read about several "apply" functions. They may help you do
what you are trying.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Fredrik Karlsson
Sent: Saturday, June 11, 2011 3:13 AM
To: R-Help List
Subject: [R] How d
It will be helpful on this forum to use metric measures: 12 Lakh is 1.2
million, thus your data is 1.2 million observations x 15 variables. I do not
know the intricacies of R. You may have to wait for someone with that
knowledge to respond.
Including some relevant portions of error messages and co
Dear list,
I´m having a little trouble with adding vertical lines to a histogram.
I need to draw a matrix of histograms (using facets), and in each
histogram add a vertical line indicating the mean value of the data in
each facet. According to the last example in the geom_hline help, to
display
Dose R have a function to calculate NDCG?
http://en.wikipedia.org/wiki/Discounted_cumulative_gain#Normalized_DCG
Thanks!
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-proj
On 11/06/11 03:35, Santosh wrote:
Dear Experts,
I notice that there are different ways of writing programs. Was wondering if
there is anything like a standard which could be used to write good/complete
R programs, maintain quality, easy to debug, a standard/practice that can be
consistent in an
Tk windows run asynchronous to the rest of R, so you could write a small
function that lets you type the command into a Tk window and runs it while you
continue to work in the main R, then the window could signal you when the
function finishes.
-Original Message-
From: r-help-boun...@r-
you probably need to read the Introduction to R to understand indexing:
> x
Obs X Y Z
1 1 1 0 1
2 2 0 0 1
3 3 1 1 1
4 4 0 1 1
5 5 1 1 0
6 6 0 0 0
> x[4, "Y"] <- 0
> x
Obs X Y Z
1 1 1 0 1
2 2 0 0 1
3 3 1 1 1
4 4 0 0 1
5 5 1 1 0
6 6 0 0 0
On Fri, Jun 10, 2011 at 5:42 PM
Dear R experts,
I have a problem that is a related to the question raised in this earlier
post
https://stat.ethz.ch/pipermail/r-help/2007-January/124064.html
My situation is different in that I have only 2 predictors (coordinates x,y)
for local regression but a number of global ("parametric")
Dear All,
I have been working with R(desktop version) in VISTA. I have the latest
version R 2.13.0. I have been working with few data-sets of size 12Lakh * 15
and my code is quite computing intensive ( applying MCMC gibbs sampler on a
posterior of 144 variables) that often runs into a memory issue
--- Begin Message ---
Hi Barjesh,
I am not sure which data you analyze, but once I had a similar situation
and it was a multicolinearity issue. I realized this after finding a
huge correlation between the independent variables, then I dropped one
of them and signs of slopes made sense.
Beforehand
Hello all,
I am wondering if there is a way to change the value of one cell in R. For
instance let's say I have a hypothetical data frame that looks like this:
Obs X Y Z
11 0 1
20 0 1
31 1 1
40 1 1
51 1 0
60 0 0
I would like to change the value of the 4th observation in t
Hi All,
I have the following dataset (triplicates values of 5 independent
measurements and duplicate vaues of a control):
12 3 4 5 C
181.8 58.2 288.9 273.2290.953.9
120.3 116.8108.9 281.3 446 39.6
86.1
Thanks for your answer. The reason I want the data to be uniform: It's the
first step in a machine learning project I am working on. If I know the data
isn't uniformly distributed, then this means there is probably something
wrong and the following steps will be biased by the non-uniform input data
Is this what you want?
sapply(sapply(strsplit(as.character(f1$keyword),' '),nchar),sum)
Weidong Gu
On Fri, Jun 10, 2011 at 1:25 PM, Jorge Ivan Velez
wrote:
> Hi Abraham,
>
> Try
>
> foo <- function(x){
> x <- as.character(x)
> sapply(strsplit(x, " "), function(s) sum(nchar(s)))
> }
> foo(f1$key
I am with Michael. It is almost impossible to figure out what you are trying.
However, I assume, like Michael, that you regress y on x2 and find, say, a
negative effect. But when you regress y on x1 and x2, then you find a
positive effect of x2. The short answer to your question is that in this
cas
This toy example works as you seem to expect:
library(ggplot2)
dat <- data.frame(time = factor(rep(0:59, each = 100), levels = 0:59),
error = rnorm(6000))
qplot(time, error, data = dat, size = I(1), main =" title",
ylab="Error (min)", xlab="Time before ON (min)", alpha=I(1
Dear list,
I have a function that uses values from two vectors and spits out one new
vector based on all the values of the two original vectors, and with the
same length as them.
Ok, I would now like to be able to apply that function simply on two columns
in a data frame, divided by the levels o
I am interested in running R commands asynchronously.
My first choice is in the same R session that I am currently in.
Here, the goal would be to run something like
RunAsynchSameSession(myfunction(), "outputname.rda")
Once RunAsynchSameSession had started myfunction(),
RunAsynchSameSession
See the contents function in the Hmisc package.
karena wrote:
>
> Is there any function in R which does the same thing as what 'PROC
> CONTENTS' does in SAS?
>
> thanks,
>
> karena
>
-
Frank Harrell
Department of Biostatistics, Vanderbilt University
--
View this message in context:
htt
OK, that is not the correct format for the KS test (which is expecting data
ranging from 0 to 1 with a fairly flat histogram). You could possibly test
this with a Chi-squared test. Can you tell us more about how the numbers you
are looking at are generated? The Chi-squared test could be used
Yes, punif is the function to use, however the KS test (and the others) are
based on an assumption of independence, and if you know that your data points
sum to 1, then they are not independent (and not uniform if there are more than
2). Also note that these tests only rule out distributions (w
Adrienne Keller wrote:
>
> I am having problem loading packages in the newest version of R
> (2.13.0) on my Mac. I have tried to install various packages (e.g.
> lawstat, Rcmdr, car) and load them using the Package Installer and
> Package Manager menu options but I get the follow error:
>
Hi Adrienne,
I'm not familiar with your interface, but it sounds like R thinks the
package "mvtnorm" is not installed. You can see the packages you've
installed with:
row.names(installed.packages())
Is "mvtnorm" in the output of that command? You could test with the command,
"mvtnorm" %in% row.
Wow, that's really clever, I didn't know you could manipulate the
palette like that.
Thanks Dr Ripley,
Sam
On Fri, Jun 10, 2011 at 3:45 PM, Prof Brian Ripley
wrote:
> On Fri, 10 Jun 2011, Prof Brian Ripley wrote:
>
>> On Fri, 10 Jun 2011, R Help wrote:
>>
>>> Hello list,
>>>
>>> I'm trying to pl
Thanks! That did the trick.
On Jun 10, 2011, at 3:16 AM, Jim Lemon wrote:
> On 06/10/2011 06:40 AM, Karthik Kota wrote:
>> Thanks a lot! This is very helpful.
>>
>> If I have to extend this to one more condition say assign "blue" if both the
>> corresponding labels have "_Tongue_dorsum", is t
On Fri, 10 Jun 2011, Prof Brian Ripley wrote:
On Fri, 10 Jun 2011, R Help wrote:
Hello list,
I'm trying to plot nls profiles, but the plot.profile.nls function in
R doesn't seem to accept any plot.default variables. Specifically,
I'd like to be able to change the x-axis title and the colors
R Help wrote:
>
> I'm trying to plot nls profiles, but the plot.profile.nls function in
> R doesn't seem to accept any plot.default variables.
>
Package nlstools has a few nice graphical display methods.
Dieter
--
View this message in context:
http://r.789695.n4.nabble.com/Plotting-NLS-pr
On Fri, 10 Jun 2011, R Help wrote:
Hello list,
I'm trying to plot nls profiles, but the plot.profile.nls function in
R doesn't seem to accept any plot.default variables. Specifically,
I'd like to be able to change the x-axis title and the colors to black
and white. Has anyone had any luck wit
Hello,
I have a bunch of files containing 300 data points each with values from 0
to 1 which also sum to 1 (I don't think the last element is relevant
though). In addition, each data point is annotated as an "a" or a "b".
I would like to know in which files (if any) the data is uniformly
distrib
Check this out:
http://www1.maths.lth.se/help/R/RCC/
--
View this message in context:
http://r.789695.n4.nabble.com/R-program-writing-standard-practices-tp3588716p3588911.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-projec
I am having problem loading packages in the newest version of R
(2.13.0) on my Mac. I have tried to install various packages (e.g.
lawstat, Rcmdr, car) and load them using the Package Installer and
Package Manager menu options but I get the follow error:
> library(lawstat)
Loading required
Here are two different ways with your data as the data.frame xx
# Basic R
aggregate(xx$Tip, list(xx$Time), sum)
# Using the rshape package
library(reshape2)
yy <- melt(xx, id=c("Time"), measure.vars=c("Tip"))
dcast(yy , Time ~ variable , sum)
--- On Thu, 6/9/11, Trying To learn again wrote:
I am trying to overlay raw data with a boxplot as follows:
pp = qplot(factor(time, levels=0:60, ordered=TRUE),
error, data=dfsub, size=I(1), main =" title", ylab="Error
(min)",
xlab="Time before ON (min)", alpha=I(1/10),
ylim=c(-30,40),geom="jitter") +
Hello list,
I'm trying to plot nls profiles, but the plot.profile.nls function in
R doesn't seem to accept any plot.default variables. Specifically,
I'd like to be able to change the x-axis title and the colors to black
and white. Has anyone had any luck with this?
If not, is there a way to ove
Hi Abraham,
Try
foo <- function(x){
x <- as.character(x)
sapply(strsplit(x, " "), function(s) sum(nchar(s)))
}
foo(f1$keyword)
HTH,
Jorge
On Fri, Jun 10, 2011 at 12:48 PM, Abraham Mathew <> wrote:
> I'm trying to find the total number of letters in a row of a data frame.
>
> Let's say I have
something like this:
sapply(strsplit(as.character(
f1$keyword), " "), function(x){sum(nchar(x))})
hth, Ingmar
On Fri, Jun 10, 2011 at 6:48 PM, Abraham Mathew wrote:
> I'm trying to find the total number of letters in a row of a data frame.
>
> Let's say I have the following data frame.
>
> f1 <-
This will give you the unique gene values:
> colA <- c("M-012847-00" ,"M-012847-00" ,"M-015544-00", "M-015544-00",
> "M-024202-00","M-024202-00")
> colB <- c("NM_057175", "NM_057175", "NM_153008", "NM_153027", "NM_207330",
> "NM_207330")
> colC <- c( 'NARG1', 'TBDN100', 'FLJ30277', 'FLJ31659', '
Is this what you want:
> colA <- c("M-012847-00" ,"M-012847-00" ,"M-015544-00", "M-015544-00",
> "M-024202-00","M-024202-00")
> colB <- c("NM_057175", "NM_057175", "NM_153008", "NM_153027", "NM_207330",
> "NM_207330")
> colC <- c( 'NARG1', 'TBDN100', 'FLJ30277', 'FLJ31659', 'NIPAL1', 'NPAL1')
>
I'm trying to find the total number of letters in a row of a data frame.
Let's say I have the following data frame.
f1 <- data.frame(keyword=c("I live in Denver", I live in Kansas City, MO",
"Pizza is good"))
The following function gives me the number of characters in each string.
So for "I live
CGH<-as.matrix(CGH)
mode(CGH)<-"numeric"
log2(CGH)
--
View this message in context:
http://r.789695.n4.nabble.com/How-to-log-2-transform-a-matrix-tp839455p3588441.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org ma
Dear all,
I posted this two years ago, getting no answers or suggestions - now I
am trying again, hoping something new is available in R.
I am interested in an application of linear multilevel model with
unequal selection probabilities at both levels.
Do you know if there is an R function f
> Date: Fri, 10 Jun 2011 09:53:20 +0530
> From: bkkoc...@gmail.com
> To: r-help@r-project.org
> Subject: [R] Linear multivariate regression with Robust error
>
> Dear all,
>
> i am doing linear regression with robust error to know the effect of
>
Hello all!
I am currently trying to sort a data frame in a particular way, but I am having
some difficulties with this. Specifically I want to sort the below dataset in
such a way that there is only one line per ProteinID and if there are multiple
GeneID or GeneName entries for a single prote
I can successfully read a GML file using read.graph (e.g. those at
http://www-personal.umich.edu/~mejn/netdata/ , the football data set in
particular). However, I don't seem to be able to read the vertex labels
that are in the GML file; or maybe I am, but I cannot get at them?
I suspect I'm not re
Hi Kieran,
I'm not very familiar with lattice, but here's a workaround that works for
me. Basically, I just created a new data.frame column that was a factor
(combo$zf), and forced its levels to be what you're looking for here.
require(lattice)
x<-c(1,2,3)
y<-c(2,4,6)
z<-c(0.1,0.5,2)
combo<-expa
On 6/10/2011 12:23 AM, Barjesh Kochar wrote:
Dear all,
i am doing linear regression with robust error to know the effect of
a (x) variable on (y)other if i execute the command i found positive
trend.
But if i check the effect of number of (x.x1,x2,x3)variables
on same (y)variable the
Dear Experts,
I notice that there are different ways of writing programs. Was wondering if
there is anything like a standard which could be used to write good/complete
R programs, maintain quality, easy to debug, a standard/practice that can be
consistent in an enterprise environment. Also, are th
See ?scale_colour_manual
Best,
Ista
On Fri, Jun 10, 2011 at 9:55 AM, Immanuel B wrote:
> Hey all,
>
> I'm trying to replicate some plots with ggplot2. The problem is that I
> need to specify the color for every
> attribute (drug). If I use the code below the colors get automatically
> assigned b
Hey all,
I'm trying to replicate some plots with ggplot2. The problem is that I
need to specify the color for every
attribute (drug). If I use the code below the colors get automatically
assigned but I need to plot drug1 in black drug2 in blue
etc.
How do I do that?
q = qplot(days,vol,data = cell
# Let's say your expression data is in a matrix
# named expression in which the rows are genes
# and the columns are samples
myvars <- apply(expression,1, var,na.rm=TRUE)
myvars <- sort(myvars,decreasing=TRUE)
myvars <- myvars[1:200]
expression <- expression[names(myvars),]
dim(expression)
Also
Thank you. The new article linked below is excellent. BTW, I have
had trouble getting the sample code to run.In particular, there is
a variable k that does not appear to be set when it is used at line
227.
Here is the line where it is called:
fit <- optim(par = rep(0, 2 * k), fn = logLik,
On 10/06/2011 9:01 AM, Nipesh Bajaj wrote:
Dear all, somebody please look into my problem here? Does it not
contain sufficient information? Please let me know how can I post my
question more complete.
You could try following the posting guidelines, which suggest this
question belongs in the R-
Dear all, somebody please look into my problem here? Does it not
contain sufficient information? Please let me know how can I post my
question more complete.
Thanks,
-- Forwarded message --
From: Nipesh Bajaj
Date: Fri, Jun 10, 2011 at 12:57 AM
Subject: package.skeleton() does
On 10.06.2011 08:54, Xiaobo Gu wrote:
Hi Professor Brian,
Thanks for your reply.
I think there are many statisticians here, and it is somehow R
related, hoping someone can
help me.
I have done a simple test, using a sample csv data which I post if need.
donut<- read.csv(file="D:/donut.csv",
On Jun 9, 2011, at 11:35 AM, Simon Wood wrote:
> I think that the main problem here is that smooths are not constrained to
> pass through the origin, so the covariate taking the value zero doesn't
> correspond to no effect in the way that you would like it to. Another way of
> putting this is t
First a word of caution: Forward, backward, and stepwise regression analyses
are not well received among statisticians. There are many reasons for this.
Some of the reasons include:
(1) The p value computed at each step is computed ignoring all the previous
steps. This can lead to incorrect infe
Thank you Henrik and Rolf. My migraine just disappeared. : )
myobjects = ls(pattern='^RH')
dataobj = mget(myTemp,.GlobalEnv)
map = Reduce(merge,dataobj)
did the trick. do.call() didn't cut it for some reason . . . it
returned an " 'x' is missing " error. But Reduce works quite nicely for
Hi
> [R] How to subset based on column name that is a number ?
>
> Hi,
>
> I have a data frame with column names "1", "2", "3", ... and I'd like to
extract
> a subset based on the values in the first column. None of the methods I
tried
> worked (below).
>
>
> x <- subset(dframe, 1 = = "My
Hi
>
> [R] what is the mistake?? the coding still not function. no result
display
>
> #lda.r
> > #
> > #Author:Amsha Nahid, Jairus Bowne, Gerard Murray
> > #Purpose:Perform Linear Discriminant Analysis (LDA)
> > #
> > #Input:Data matrix as specified in Data-matrix-for
Hi,
Yes, check for function ann in package "yaImpute".
Regards,
Carlos Ortega
www.qualityexcellence.es
On Thu, Jun 9, 2011 at 1:51 PM, Christian Hennig wrote:
> Hi there,
>
> is there any R-function for k-nearest neighbour agglomerative hierarchical
> clustering?
> By this I mean standard aggl
Which statistical principles are you invoking on which to base such analyses?
Frank
Sergio Della Franca wrote:
>
> Dear R-Helpers,
>
> I want to perform a logistic regression on my dataset (y).
>
> I used the following code:
>
> logistic<-glm(formula="interest_variable"~.,family = binomial(lin
> Subject: RE: [R] error with geomap in googleVis
> Date: Fri, 10 Jun 2011 11:06:47 +0100
> From: markus.gesm...@lloyds.com
> To: marchy...@hotmail.com; r-h...@stat.math.ethz.ch
>
> Hi Mike,
>
> I believe you are trying to put two charts on the same page.
Hi Mike,
I believe you are trying to put two charts on the same page.
The demo(googleVis) provides you with an example for this.
So applying the same approach to your data sets would require:
library(googleVis)
df<-data.frame(foo=c("Brazil","Canada"), bar=c(123,456))
map1<-gvisGeoMap(df,location
?duplicated
Sent from my iPad
On Jun 10, 2011, at 1:22, Z B wrote:
> Hi,
>
> I want to write a set of commands instead of "unique(x)" to remove duplicate
> numbers from a vector.
>
> Would you please help me. I don't know how to compare a vector numbers
> together. I am new to R.
>
> Thanks.
On 06/10/2011 08:10 AM, Sam Albers wrote:
Hello all,
I have been using an instrument that collects a temperature profile of a
water column. The instrument records the temperature and depth any time it
takes a reading. I was sampling many times at discrete depth rather than a
complete profile of
Dear Dennis
Thanks for the comments, I read thru the script that was originally
created and gathered that the issue was because of the use of index.cond
in the xyplot function.
I modified the script to drop the index.cond parameter in the function and
now it works to give the subject order as i
On 06/10/2011 06:40 AM, Karthik Kota wrote:
Thanks a lot! This is very helpful.
If I have to extend this to one more condition say assign "blue" if both the
corresponding labels have "_Tongue_dorsum", is there a straight forward function. Doing
something like below is overriding the colors ass
On 10/06/11 14:57, Ben Zaitchik wrote:
Hello,
I have a large number of raster objects in memory, with names RH100,
RH101, RH102, etc. (myobjects <- ls(pattern='^RH')).
These rasters are sections of a continuous map, and I would like to
combine them using the RasterObject merge tool in package
On 09.06.2011 22:40, Karthik Kota wrote:
Thanks a lot! This is very helpful.
If I have to extend this to one more condition say assign "blue" if both the
corresponding labels have "_Tongue_dorsum", is there a straight forward function. Doing
something like below is overriding the colors assi
Zhishi Wang wrote:
>
> Hi all,
>
> If I have a vector A<-1:6, I would like to convert A to an upper
> matrix M=[0 1 2 3 ; 0 0 4 5 ; 0 0 0 6; 0 0 0 0].
> That is, if the length of the known vector is n, then the order m of
> the matrix I'd like to have should satisfy m(m-1)/2=n
> How could I do t
Amit Patel writes:
>>plot(BHPLS1, "loadings", comps = 1:2, legendpos = "topleft", labels =
>>"numbers",
>>xlab = "nm")
>
> Error in loadingplot.default(x, ...) :
> Could not convert variable names to numbers.
>
>
> str(BHPLS1_Loadings)
> loadings [1:8892, 1:60] -0.00717 0.00414 0.02611 0.0
On Tue, 2011-06-07 at 17:24 +0100, Michael Ash wrote:
> This question pertains to setting up a model in the package "dlm"
> (dynamic linear models,
> http://cran.r-project.org/web/packages/dlm/index.html
The author of the dlm package has just published a paper on state space
models in R including
Hi,
I want to write a set of commands instead of "unique(x)" to remove duplicate
numbers from a vector.
Would you please help me. I don't know how to compare a vector numbers
together. I am new to R.
Thanks.
[[alternative HTML version deleted]]
_
77 matches
Mail list logo