On May 12, 2012, at 04:40 , Michael wrote:
> Hi all,
>
> Could you please help me?
>
> I am trying to understand why this line works:
>
> lm1x = lm(y~X-1, tmp)
>
> Here it seems that I was combining the design matrix and the data frame...
>
> And X below is not a single column, in fact, it's
Hello.
I'm trying to scaling these attribute values using sigmoid and I created a
function as followed:
mySigmoid <-function(){ medGen = read.csv("medB1.csv"); data(medGen);
medGen.signorm=rangenorm(medGen,method="signorm"); op=par(mfrow=c(2,3))
plot(medGen.signorm[,1])par(op)
Dear All
Is there any function for "median test" in R?
Best Regards,
Soheila
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-p
Hi Soheila,
There you go:
median.test<-function(y1,y2){
z<-c(y1,y2)
g <- rep(1:2, c(length(y1),length(y2)))
m<-median(z)
fisher.test(z<=m,g)$p.value
}
group1 <- c(2, 2, 5, 5, 4, 3, 1, 5,5,5,5,5)
group2 <- c(3, 1, 3, 1, 4, 1, 1, 1, 7, 1, 1, 1, 1, 1, 2)
boxplot(group1, group2)
median.test(g
Hi,
On May 12, 2012, at 5:23 AM, Soheila Khodakarim wrote:
> Dear All
>
> Is there any function for "median test" in R?
>
Of course, and more than one. You might try going to rseek.org and searching
for "median test" as a way to get started.
Sarah
> Best Regards,
> Soheila
>
>[[alte
Le jeudi 10 mai 2012 à 17:12 -0700, Triss.Ashton a écrit :
> Alekseiy, I tried your recommendation with several variations. It still does
> not run. I think the problem has to do with R2.15 and the refreshed TM
> package.
It works here with R 2.15.0 and tm 0.5-7.2 (development version), all
other
>I am trying to understand why this line works:
>
> lm1x = lm(y~X-1, tmp)
Well, I would not normally define a data frame element as a matrix myself
(though I might well define a list element as one). But specifying a matrix as
the terms part of an lm is documented in lm's details:
"If response
Please nevermind as I have just solved this.
Suhaila
From: bell_beaut...@hotmail.com
To: r-help@r-project.org
Date: Sat, 12 May 2012 20:44:16 +1200
Subject: [R] Transform Data using Sigmoid Function
Hello.
I'm trying to scaling these attribute values using sigmoid and I created a
function as
I have a matrix like this
Name 12
3 45
NM_0010395141.033557047 0.74698795180.90045248870.8613861386
0.7952499048
NM_001039
Greetings!
I am using quantstrat and xts to do some intraday work and come up
with this problem. the xts object temp in the following example is
attached as and rda file.
> head(temp)
A.Open A.High A.Low A.Close A.Volume
2012-02-01 08:29:00 42.47 43.76 41.410 43.76 207
Hi R Listers,
I am trying to upload a data file and I received this message. It seems that
I am still able to make graphs and Aeventexhumed still works in the
analysis. Can I ignore this message or do I need to do something about this?
Jean
> require(plyr)
Loading required package: plyr
> turt
Hello,
Many people mistake 'summary' for a special kind of print function.
At least I did, at first.
The fact is that 'summary' does it's own computations and outputs the result
of those computations, to be printed by the appropriate print method.
Simply put, what you need is
summary(fit)$s20
o
Hi everybody,
I am currently trying to forecast some double seasonal time series by using
the function dshw. I want to access the standard errors to build the
confident interval for my forecast. I am using to following code :
fit<-dshw(eem,period1=7,period2=48,h=48)
then by using summary(fit), I
The right response is not to use attach().
What's going on is that you have objects by those names in your global
workspace and in the object you are attaching. Since .GlobalEnv is
always (?) first on the search path, you won't be able to see those
that you just added unless you remove the ones in
> R Michael Weylandt
> on Sat, 12 May 2012 09:20:06 -0500 writes:
> The right response is not to use attach(). What's going
> on is that you have objects by those names in your global
> workspace and in the object you are attaching. Since
> .GlobalEnv is always (?) fi
That does not look like a matrix but a data frame. Do a class(dataname) to
check.
It is much better to present the data in a useable format. Have a look at
?dput for a way to provide the data.
However if we assulme your data is xx, this may do what you want if I
understand you correcctly.
x
On Sat, 12 May 2012, rmje wrote:
I have a matrix like this
Name 12
3 45
NM_0010395141.033557047 0.74698795180.90045248870.8613861386
0.7952499048
NM_0010
I'm not sure if this is what you want but try
library(reshape2)
dat3 <- merge(dat1, dat2)
xx <- melt(dat3, id=c("phone", "request"))
dcast(dat3 , phone + name + address ~ request )
John Kane
Kingston ON Canada
> -Original Message-
> From: gloriaal...@yahoo.it
> Sent: Fri, 11 May 20
Hello,
If by all possible gene ratios you mean all pairwise column ratios, try
the following.
# Make up some data
x <- matrix(1:24, ncol=6)
cmb <- combn(ncol(x), 2)
r1 <- apply(cmb, 2, function(j) x[, j[1]]/x[, j[2]])
r2 <- apply(cmb, 2, function(j) x[, j[2]]/x[, j[1]])
cbind(r1, r2)
Note th
Dear R-help,
Please direct answers to this question to the R-sig-finance list copy
of this question
(http://stat.ethz.ch/pipermail/r-sig-finance/2012q2/010209.html)
Thank you,
Garrett
On Sat, May 12, 2012 at 4:39 AM, Jim Green
wrote:
> Greetings!
>
> I am using quantstrat and xts to do some int
Hello,
I'm posting this again (with some small edits). I didn't get any replies
last time...hoping for some this time. :)
Currently I'm only coming up with brute force solutions to this issue
(loops). I'm wondering if anyone has a better way to do this. Thank you for
your help in advance!
The pr
Is there a way to order data and subset it at the same time??
I want to sort all the members of group A by their values in column 3. (I'll
then do the same for each subsequent group.) This could be done in a loop
building up another vector, but I like to avoid loops in R.
On 12-05-2012, at 20:04, Noah Silverman wrote:
> Is there a way to order data and subset it at the same time??
>
>
>
> I want to sort all the members of group A by their values in column 3. (I'll
> then do the same for each subsequent group.) This could be done in a loop
> building up anoth
Here is an example of how you might do it. It uses a technique of
counting how many items are in a queue based on their arrival times;
it can be used to also find areas of overlap.
Note that it would be best to use a list for the 's' end points
> # note the next
Bernard,
Thanks, but I can't take that shortcut.
The data is an xts object, and I may not want to order every group. So, I need
a way to just order one group at a time.
Thoughts?
--
Noah Silverman
UCLA Department of Statistics
8208 Math Sciences Building
Los Angeles, CA 90095
On May 12, 2012
Just write a function so that you have a "one-liner" in your script.
It will probably be a lot simpler than trying to type some convoluted
one-liner.
On Sat, May 12, 2012 at 2:58 PM, Noah Silverman wrote:
> Bernard,
>
> Thanks, but I can't take that shortcut.
>
> The data is an xts object, and I
Thank you so much.
Best Regards,
Soheila
On Sat, May 12, 2012 at 2:45 PM, Tal Galili wrote:
> Hi Soheila,
> There you go:
>
> median.test<-function(y1,y2){
> z<-c(y1,y2)
> g <- rep(1:2, c(length(y1),length(y2)))
> m<-median(z)
> fisher.test(z<=m,g)$p.value
> }
>
> group1 <- c(2, 2, 5, 5
Thank you so much.
But I can not open this link, rseek.org:(
Best Regards,
Soheila
On Sat, May 12, 2012 at 2:40 PM, Sarah Goslee wrote:
> Hi,
>
> On May 12, 2012, at 5:23 AM, Soheila Khodakarim
> wrote:
>
> > Dear All
> >
> > Is there any function for "median test" in R?
> >
>
>
> Of course
can be done in one line, but it is annoying and ugly, so you probably
shouldn't be doing it that way:
>sleep[sleep$group == 1,] <-sleep[sleep$group == 1,][order(sleep[sleep$group ==
>1,1]),]
>sleep
extra group ID
1 -1.6 1 2
2 -1.2 1 4
3 -0.2 1 3
4 -0.1 1 5
50.0
This is a followup to a recent post on using atop() to obtain
multiline expressions.
My reading of the plotmath docs makes it clear that issuing (in base
graphics) the specification
par(cex = 2)
doubles symbols and regular text in subsequent plotmath expressions.
However, it is unclear to me wha
The following data spans out to 2012 and when graphing out the data - R
defaults dates on x axis only shows the years eg 200520072009
My question is how can I get the graph to show more dates on the axis - eg
every qtr or 6 months or every month etc
PRODUCT,DATE,AMOUNT_1,AMOUNT_2
A,3/1/
Thank you very much for your answer. I didn't know this.
However, I tried what you suggest and it doesn't work either :
- by typing summary(fit)$s20, I get exactly what I had with summary(fit)
and
- by typing sfit<-summary(fit) and then sfit$s20, I get NULL...
these facts seem very strange to me.
Hello,
You're right, sorry for the misleading (general purpose) information.
fit$model$s20
(The object can be inspected with names(fit) and then print each of the
components or names(fit$model).)
Rui Barradas
plocq wrote
>
> Thank you very much for your answer. I didn't know this.
> However,
Thanks so much Rui. I really appreciate all the help.
I implemented the code and it ran fine. I was wondering how I could include the
probeset ids as probeset1:probeset2 in the final output so that I know which
ratios are for which probeset pairs.
Thanks so much.
Som.
Date: Sat, 12 May 2012 0
What am I thinking about?
Objects should be inspected with str(object)
R.B.
Rui Barradas wrote
>
> Hello,
>
> You're right, sorry for the misleading (general purpose) information.
>
> fit$model$s20
>
> (The object can be inspected with names(fit) and then print each of the
> components or na
Thank you very much for all your tips! It works perfectly know and I begin to
understand how R is working.
I will now see how to construct this confident interval.
Have a nice evening!
--
View this message in context:
http://r.789695.n4.nabble.com/access-the-se-of-a-forecast-tp4628847p4629088.h
Hi,
In the following lines of code are inside of a function, where "TRAIT1" is
a function variable calling a column-name inside of the data.frame "new3".
This works just fine:
m2 <- lmer(get(TRAIT1) ~ perm.score + (1|site), data=new3)
but this will not work,
m3 <- lme(get(TRAIT1) ~ perm.sc
I apologize up front if this has been covered elsewhere - but I can't find
any such question.
I have a data set that contains academic data: term (i.e., semester),
student id, dept, class, success (1=Y, 0=N)
I want to look at dept by term to determine descriptive statistics for
success to failure
please note that I edited the original message to say:
> length(with(new3, perm.score))==length(with(new3, get(TRAIT1)))
[1] TRUE
chuck.01 wrote
>
> Hi,
> The following lines of code are inside of a function, where "TRAIT1" is
> a function variable calling a column-name inside of the da
Hello,
I'm glad it helped. Now to make the result readable. (I had thought of it.)
pairwise.ratios <- function(x, prefix="probeset", char=":"){
n <- ncol(x)
cn <- colnames(x)
if(length(cn) == 0){
cn <- gsub(" ", "0", formatC(seq.int(n), width=nchar(n)))
I am trying to write data to csv but I am having issues with the separations.
Basically I have some results that I get with R that I copied and pasted
into word and then saved as .txt
I want to write the results to csv because it's easier to make tables in
word (all I would have to do is copy a
Hi,
How can I round up and down to the nearest hundredth
example:
x <- 0.18
how do I round down to 0.15?
how do I round down to 0.20?
--
View this message in context:
http://r.789695.n4.nabble.com/round-up-down-to-nearest-hundredth-tp4629451.html
Sent from the R help mailing list archive at
Here is some code that I've been fiddling with for years
(since I wanted to provide evidence that our main office
needed more modems and wanted to show how often
both of them were busy). It does set operations and a
bit more on collections of half-open intervals. (Hence
it drops zero-length inter
I can.
There are alternatives, though.
RSiteSearch("keywords") at the R prompt.
Google with the capital letter R in your search.
---
Jeff NewmillerThe . . Go Live...
DCN:Bas
By definition a csv is comma-separated so you can't set a separator. The
general function which you seem to be seeking is write.table
Michael
On May 12, 2012, at 3:33 PM, DL wrote:
> I am trying to write data to csv but I am having issues with the separations.
>
> Basically I have some resul
Hi,
I have a query about sqldf, and dates in general. I couldnt find much on
the net or on the forums, hence I am here. Here is the issue:
I want to write a function that accepts 3 arguments: date1, date2 and a
dataframe, say 'df'. Within the function, I want to populate a temp
dataframe which es
Hi Bert,
I think the 'cex=' argument applies to the outermost 'atop()'.
It then applies that size specification to each of the two
components of the atop(a,b). If one of the components is itself
another atop(a,b), then the individual parts are sized downward
to produce the required cex for the un
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
> On Behalf Of DL
> Sent: Saturday, May 12, 2012 1:33 PM
> To: r-help@r-project.org
> Subject: [R] Help with writing data to csv
>
> I am trying to write data to csv but I am having issues with
Hi Noah,
I think it is hard to say what is best without your real example. Is
the goal elegance or speed? I have not tried it, but if you are
ordering say 9/10 groups, I would think you are better off calling
order once, even though you will not use it for one group.
I also think if you are ord
On Sat, May 12, 2012 at 6:18 PM, Shivam wrote:
> Hi,
>
> I have a query about sqldf, and dates in general. I couldnt find much on
> the net or on the forums, hence I am here. Here is the issue:
>
> I want to write a function that accepts 3 arguments: date1, date2 and a
> dataframe, say 'df'. Withi
Here is an example:
library(nlme)
library(lme4)
library(MASS)
data(petrol)
# a variable for one of the columns in petrol
Y.VAR <- "Y"
# This works:
lmer(get(Y.VAR)~EP +(1|No), data=petrol)
# This doesn't:
lme(get(Y.VAR)~EP, random= ~1|No, data=petrol)
# but this does:
lme(Y~EP, random= ~1|No,
Hello,
Nothing wrong with me, maybe your R session has some conflicting objects.
Running the function in the previous post on the first 4 rows and first 6
columns of your dataset the result was (copy&paste to your session)
result <- structure(c(8.74714923153198, 1.83094400392095, 9.92065138471113
Hi Rui,
Thanks once again. I really appreciate it.
I tried using the code with the following dataset:
Sample
P1
P2
P3
P4
P5
P6
P7
P8
P9
P10
S1
5292.9
605.1
5213.9
1710.6
1407.8
1079.4
1379.6
9321.4
6951
1205.8
S2
104.6
57.129
625.
Thank you for replying. The result of the first command was an excel sheet
with the data separated by rows but not columns, which is basically what I
get when I copy and paste into Excel. I would like to have the information
separated by rows and columns so I can just copy and paste it into a table
One replier worried about doing multiple operations on the graphics
device in parallel. To avoid this, try saving the output of your plot
function instead of immediately displaying it (if the function allows
this). Then display everything when you're all done.
Norm Matloff
To: Alaios
Subject:
I have had no problem at all with writing CSV files and copy/pasting
the data into WORD. What you really need to show is what is the
actual output in the file that you are working with, and then exactly
what you are doing with the data in WORD. So I know that it works
fine, so it must be "pilot e
On May 12, 2012, at 7:24 PM, DL wrote:
Thank you for replying. The result of the first command was an excel
sheet
with the data separated by rows but not columns, which is basically
what I
get when I copy and paste into Excel. I would like to have the
information
separated by rows and colu
I am using the code below to output some network measures:
central_social <- data.frame(V(s641_social)$name, indegree_social,
outdegree_social, incloseness_social, outcloseness_social,
betweenness_social, eigen_social)
and I get the following error:
Error in Re(z) : non-numeric argument to func
Take a look at the data in a text file and you will see that it is a
CSV file with a single column:
"1
ONE.LEVEL.ANALYSIS.WITH.Speaker..random..and.folseg..5.04e.08preseg..3.77e.07position..0.402sylstress..0.93.
"
"2
I apologize. You were right.
You are a genius!
Thanks so much!
Best Regards,
Som.
Date: Sat, 12 May 2012 15:20:52 -0700
From: ml-node+s789695n4629656...@n4.nabble.com
To: genome1...@hotmail.com
Subject: RE: Calculating all possible ratios
Hello,
Nothing wrong with me, maybe your R
My guess is that this is sensitive to the size of the graphics device being
used so the simplest thing to do is simply make your plot device bigger.
Otherwise, we'll need a reproducible example.
Michael
On May 12, 2012, at 1:49 PM, pip wrote:
> The following data spans out to 2012 and when
This version of my code makes the R process consume unreasonable amounts of RAM:
datf <- rbind(lapply(mylist, function(item) {
with(item, data.frame(col1, col2, col3))
}))
This version works fine:
datf <- lapply(mylist, function(item) {
with(item, data.frame(col1, col2, col3)
Hi,
I am trying to specify a prior for my HMM Model. I would like both my prior
and transition probablities to be dependent on covariates. I was trying this
out using the "speed" dataset within depmixS4, but I get the following
error:
>mod <-
depmix(list(rt~1,corr~1),data=speed,nstates=2,family=li
On May 12, 2012, at 6:27 PM, Peter Ehlers wrote:
Hi Bert,
I think the 'cex=' argument applies to the outermost 'atop()'.
It then applies that size specification to each of the two
components of the atop(a,b). If one of the components is itself
another atop(a,b), then the individual parts are s
I need help writing function that takes three categorical inputs and returns
a vector of summary statistics based on these inputs. The data set contains
information on retail goods that can be specified by their retail segment,
brand name, and type of good along with its retail price and what it
ac
Hai I'm Dee. I'm trying to write var data from these codes inside excel
file. My directory to store the data is *D:\FYP\image* .
these are my codes, can you help give an advice or idea with my problem:
l*ibrary("biOps")
library("waveslim")
library("xlsReadWrite")
x <- readTiff("D:\\FYP\\image\\Si
Hai, I'm trying to write these var output data from these codes inside excel
file. My directory to store the data is
/D:\FYP\image /
but receive an error message :
/Error in write.xls(mydata, "D:\\FYP\\image.mydata.xls") :
object 'mydata' not found/
these are my codes, can you help give an ad
This looks like homework. Please read the Posting Guide mentioned at the end of
every posting regarding homework.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#.
68 matches
Mail list logo