Dear Erin,
Not exactly elegant, but
> e<-expression(list(R == 100 * (1 - 2 * y/1)))
> ee <- e[[1]][2]
> ee
(R == 100 * (1 - 2 * y/1))()
> eval(parse(text=(substring(paste(ee), 5))), list(y=5))
[1] 99.9
Regards
Søren
-Original Message-
From: r-help-boun...@r-project.org [mailto:
Hello,
Where is the problem in this programming. I want two way matrix, but it gives
problem.
The program is given below:
Thanks in advance.
Regards
Fazli Raziq
rep = 2
genes = 5
pred = c()
iter = array (dim = c(rep, pred))
pred = array(dim = c(1, genes))
m = c()
l = 1
w = 1
for(m in 1:rep)
On 19-06-2013, at 09:30, Fazli Raziq wrote:
> Hello,
>
> Where is the problem in this programming. I want two way matrix, but it gives
> problem.
What is the problem?
What are you expecting and what are you getting?
> The program is given below:
>
> Thanks in advance.
>
> Regards
> Fazli R
Hello folks,
I`m using knitr on R studio, which make it easy to use, but a coworker of
mine would like to run it on "simple" R. So I was wondering if you know what
is the equivalent of the button "knit HTML" in RStudio in R. I tried
knit2HTML(
Graph 1 <#location1> Graph
I'm cc'ing this to the R-help list.
Please reply to the list and privately.
You will get more response that way.
Your reply does not address the issue I mentioned.
Berend
On 19-06-2013, at 10:29, Fazli Raziq wrote:
> Dear Mr. Berend,
>
> I want to construct "Two way Matrix". The Algorithm i
On 19-06-2013, at 10:32, Berend Hasselman wrote:
>
> I'm cc'ing this to the R-help list.
>
> Please reply to the list and privately.
Sorry. I meant NOT privately.
Berend
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-
Hello all,
I want to construct "Two way Matrix". The Algorithm is like:
1) Data of time with censoring or events
2) Predictor variables (genes)
3) Resample original data in step 1 and 2 by WR
4) Apply Coxph Model to resample data. (Apply Surv function to each Predictor
variable, individually
Hi all!
I am using this script to automatically generate txt file (raster map in ASCII
format) from a big txt file
x<-read.table("test.txt",header=T) # if headers are present in "test.txt" or
x<-read.table("test.txt") # Actually, read.table() command skips the blank
lines. n<-256 for (i in
Hello,
Your code doesn't work because you are calling a non-function:
hist(singlefile$CL1( ... )) # here
singlefile$CL1 is not a function.
For us to be able to help you please do the following.
1. paste the output of the command below in a post
dput(head(singlefile, 50))
2. Post a call to h
Hello all, now I'm trying to switch from Excel to R to deal with the data,
and as a newbie i got the problem as follows.
suppose I have a data named "test"
test<- data.frame(year=c(1996:2011),
Y=c(74163.6,81658.5,86531.6,91125.0,98749.0,109028.0,120475.6,136613.4,160956.6,187423.5,222712.5,266599.
On Wed, Jun 19, 2013 at 12:04 PM, Yanyuan Zhu wrote:
> Hello all, now I'm trying to switch from Excel to R to deal with the data,
> and as a newbie i got the problem as follows.
>
> suppose I have a data named "test"
> test<- data.frame(year=c(1996:2011),
> Y=c(74163.6,81658.5,86531.6,91125.0,9874
On Wed, Jun 19, 2013 at 6:24 AM, R. Michael Weylandt
wrote:
> On Wed, Jun 19, 2013 at 12:04 PM, Yanyuan Zhu wrote:
>> Hello all, now I'm trying to switch from Excel to R to deal with the data,
>> and as a newbie i got the problem as follows.
>>
>> suppose I have a data named "test"
>> test<- data
Hi Alex,
Have you read the ?knit or ?knit2html documentation? I don't believe
there is a kit2HTML function (notice the uppercase), and the input
should be the path to a file. Please do read the documentation.
Best,
Ista
On Wed, Jun 19, 2013 at 3:53 AM, AlexPiche
wrote:
> Hello folks,
>
> I`m us
diff(test$Y)/(test$Y)[-1] calculates (Y(t)-Y(t-1))/Y(t).
To get (Y(t)-Y(t-1))/Y(t-1) instead, use
diff(test$Y)/(test$Y)[-length(test$Y)]
or better
diff(test[,"Y"])/test[-nrow(test), "Y"]
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behal
Dear all,
I made a simple test of the Cholesky decomposition in the package 'Matrix',
by considering 2 variables 100% correlated.
http://blogs.sas.com/content/iml/2012/02/08/use-the-cholesky-transformation-to-correlate-and-uncorrelate-variables/
The full code is below and can be simply copy&paste
On Wed, Jun 19, 2013 at 7:04 AM, Yanyuan Zhu wrote:
> Hello all, now I'm trying to switch from Excel to R to deal with the data,
> and as a newbie i got the problem as follows.
>
> suppose I have a data named "test"
> test<- data.frame(year=c(1996:2011),
> Y=c(74163.6,81658.5,86531.6,91125.0,98749
Hi all. Sorry for posting again such a topic but I went through previous
posts but couldn't find a solution.
I use the following code to fit an exponential model to my data. I have 4
different datasets. For 3 datasets nls seems to work fine and I have no
error messages. But for 1 dataset I am get
Hi all:
I met a question about lmer.
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
summary(fm1)
...
Fixed effects:
Estimate Std. Error t value
(Intercept) 251.405 6.825 36.84
Days 10.467 1.5466.77
...
My question:
Why p values of (Intercept) an
Hello,How do I extract only the value from the quantile
function?example:quantile (x, probs = 0.10) 10%-1.83442I want to add salt
only the number -1.83442
SincerelyFrancesco Miranda
[[alternative HTML version deleted]]
Dear R community,
I would like to approximate a time serie as linear combination of a set of
many time series, minimizing the number of the time series involved in the
linear combination. Can you recommend to me any method for this? Any paper
about this?
I will appreciate much your suggestions.
Hi,
Even if you have 15 matrices, you should be able to do it in the same way.
For example in the case of 5 matrices:
set.seed(24)
A<- matrix(sample(1:50,20,replace=TRUE),ncol=4)
B<- matrix(sample(40:60,20,replace=TRUE),ncol=4)
C<- matrix(sample(1:60,20,replace=TRUE),ncol=4)
D<- matrix(sample(1:30
Hi,
May be this helps:
set.seed(28)
x<- sample(1:40,20,replace=TRUE)
qx<-quantile(x,probs=0.10)
qx
#10%
#3.8
qx+1
#10%
#4.8
attr(qx,"names")<-NULL
qx
#[1] 3.8
qx+1
#[1] 4.8
A.K.
- Original Message -
From: Francesco Miranda
To: "r-help@r-project.org"
Cc:
Sent: Wednesday, J
Try
library(lmerTest)
fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
summary(fm1)
Linear mixed model fit by REML
Formula: Reaction ~ Days + (Days | Subject)
Data: sleepstudy
AIC BIC logLik deviance REMLdev
1756 1775 -871.8 17521744
Random effects:
Groups NameV
On Wed, Jun 19, 2013 at 10:27 AM, meng wrote:
> Hi all:
> I met a question about lmer.
>
> fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
> summary(fm1)
>
> ...
>
> Fixed effects:
> Estimate Std. Error t value
> (Intercept) 251.405 6.825 36.84
> Days 10.467
I've read all the docs on knitr and some blogs on this topic, but can't
figure out how
to produce side-by-side figures in R markdown, except by composing a
single figure
in R with par(mfrow=c(1,2)).
I know this can be done easily with the LaTeX engine, but why not with
HTML output?
A small te
HI,
Probably, this is the case. It is better to provide a reproducible example
data as mentioned in the posting guide.
set.seed(24)
dat1<- data.frame(ID=c(1:3,5:8,10:14),value=sample(1:40,12,replace=TRUE))
IDs<- 1:14 #the possible ID list
setdiff(IDs,dat1$ID)
#[1] 4 9
length(setdiff(IDs,dat1$ID
Hi,
Please use ?dput().
If `lst1` is the list.
do.call(rbind,lapply(lst1,t))
# Estimate Std. Error t value Pr(>|t|)
#card1 0.000577912 0.003956905 0.1460515 0.88388493
#card2 0.005164347 0.003311546 1.5594972 0.11892405
#card3 0.002682773 0.003683422 0.7283372 0.46643165
#card
You could also use:
t(data.frame(lst1))
# Estimate Std. Error t value Pr(>|t|)
#card1 0.000577912 0.003956905 0.1460515 0.88388493
#card2 0.005164347 0.003311546 1.5594972 0.11892405
#card3 0.002682773 0.003683422 0.7283372 0.46643165
#cardva 0.003123452 0.002727940 1.1449856 0.25
Dear R Helpers,
I am stuck on some syntax and I thought that I was following one of the
examples that I found out there quite faithfully.
I just want to know how to do a t test on a single mean for whether or not
it is greater than a specific value. So I am using the data set sleep and
I want to
I'm not sure what you mean by the $variables.label property.
Are you just looking for the column names?
If your data frame is called "df", try
names(df)
Jean
On Tue, Jun 18, 2013 at 2:16 PM, Lívio Cipriano wrote:
> Hi,
>
> How can I read/retrieve the Labels strings of the $variables.label
(Re-) Read the docs (e.g. Intro to R, R Language Definition) . ...
arguments have to be named!
t.test(sleep$extra,mu=0, alt = "greater") ## works
-- Bert
On Wed, Jun 19, 2013 at 6:50 AM, Sparks, John James wrote:
> Dear R Helpers,
>
> I am stuck on some syntax and I thought that I was followin
Try this:
for (i in 1:100){
filename <- paste("file_", i, ".txt", sep="")
m <- x[((i-1)*256 + 1):(i*256), ]
meta <- paste0("ncols = ", dim(m)[2], ", nrows = ", dim(m)[1], ", cell
size = ???, etc.")
write.table(meta, filename, row.names=FALSE, col.names=FALSE)
write.table(m, filename, row.names=F
Hello
I have the following dataframe
df <- data.frame(
Project=c("Abaco","Abaco","Abac","Abaco","Abaco","Abaco",
"Abaco","Adaptclone","Adaptclone","Adaptclone","Adaptclone","Adaptclone",
"Adaptclone","Adopt","Adopt","Adopt"),
Country=c("Zimbabwe","Burkina Faso","South Africa","Madagascar","Tanz
Perhaps you are talking about the variable.labels attribute returned
by read.spss in package foreign? If so, you should try the
attributes() or the attr() function:
?attributes
?attr
-
David L Carlson
Associate Professor of Anthropology
Texas A&M University
Col
What does a plot of your data look like?
plot(ndat$dist, ndat$vario.dNEE)
Anything remotely like a two-parameter single exponential rise to a maximum
from zero as shown on this webpage, for example?
http://www.graphpad.com/guides/prism/6/curve-fitting/index.htm?reg_classic_1assoc.htm
Jean
O
Hello,
Try the following.
aggregate(Project ~ Country + Iso, data = df, FUN = length)
Hope this helps,
Rui Barradas
Em 19-06-2013 15:23, Arnaud Michel escreveu:
Hello
I have the following dataframe
df <- data.frame(
Project=c("Abaco","Abaco","Abac","Abaco","Abaco","Abaco",
"Abaco","Adaptc
Try this:
> aggregate(Project~Country+Iso, df, length)
Country Iso Project
1 Burkina Faso BF 2
2 Ethiopia ET 1
3 Ghana GH 1
4 Kenya KE 2
5Madagascar MG 2
6 Mali ML 1
7Mozambique MZ 1
8 Nigeria NG
Hi,
May be this helps:
library(plyr)
ddply(df,.(Country,Iso),summarize,NbrProj=length(Project))
# Country Iso NbrProj
#1 Burkina Faso BF 2
#2 Ethiopia ET 1
#3 Ghana GH 1
#4 Kenya KE 2
#5 Madagascar MG 2
#6 Mali ML 1
Or cast to vector:
> set.seed(28)
> x<- sample(1:40,20,replace=TRUE)
> qx<-quantile(x,probs=0.10)
> qx
> #10%
> #3.8
> as.vector(qx)
> #3.8
***
This email and any attachments are confidential. Any use...{{dropped:8}}
Hi,
I am writing this message for the benefit of the community.I have been working
with randomForestSRC on a windows machine.I have been trying for days to output
the forest to an rfz file so that I can print a graphical representation of the
tree using Ishwaran and Kogalur's java GUI for visual
Hello yet again, R People:
I was working with Ryacas and yacas last night and all was well.
Now this morning, I keep getting the following:
> a <- Sym("a")
> a
Error in summary.connection(x) : invalid connection
>
When I go to yacas from the command line, it works fine.
Any suggestions, please
> > e<-expression(list(R == 100 * (1 - 2 * y/1)))
> > ee <- e[[1]][2]
> > ee
> (R == 100 * (1 - 2 * y/1))()
> > eval(parse(text=(substring(paste(ee), 5))), list(y=5))
> [1] 99.9
The following avoids the fragile substring(paste(expression)) business:
> eval(e[[1]][[2]][[3]], list(y=5))
Dear Erin,
I don't have solution, but there is a remark on connection issues at
http://code.google.com/p/ryacas/
An alternative could be to look at the rSymPy or rmathpiper packages which may
do what you want.
Regards
Søren
-Original Message-
From: r-help-boun...@r-project.org [mailt
On Wed, Jun 19, 2013 at 1:03 AM, Erin Hodgess wrote:
> Hello again.
>
> Now I have the following:
>> xx
> [1] "Solve(1 - R/100==(2*y)/1,R)"
>> yacas(xx)
> expression(list(R == 100 * (1 - 2 * y/1)))
>>
Try the Ryacas Sym interface:
> library(Ryacas)
>
> R <- Sym("R")
> y <- Sym("y")
> ans
Hi,
Based on the information you provided, the solution should be the one I
provided earlier. Otherwise, I must have misunderstood your question. In your
first post, you mentioned the IDs range from 5:200. So, the question is not
clear.
dat1<- read.table(text="
timeSec pupilId pupilName
13
On Wed, Jun 19, 2013 at 11:50 AM, Erin Hodgess wrote:
> Hello yet again, R People:
>
> I was working with Ryacas and yacas last night and all was well.
>
> Now this morning, I keep getting the following:
>
>> a <- Sym("a")
>> a
> Error in summary.connection(x) : invalid connection
>>
>
> When I go
Greetings:
I am looking for a way to avoid using the ifelse function for
constructing a new variable. More specifically, assume I have a set
of variables with scores ranging from 1 to 30.
set.seed(12345)
x <- c(1:30)
x1 <- sample(x, 15, replace = TRUE)
x2 <- sample(x, 15, replace = TRUE)
x3 <- s
Hello,
I am trying to run the following piece of command:
svm.linear<-svm(price~., subset = generation >0, data = trainset, cost = C,
epsilon = 1, type = 'eps-regression')
If epsilon = 1, the program runs fine. For larger values, e.g. 10, I get the
following error:
Error in predict.svm(ret, x
On Jun 17, 2013, at 8:48 AM, G Vishwanath wrote:
> Can I have some help in vectorizing a series of matrix multiplications?
> Toy Example
>
> mat_size=2; num_matrices=3; num_users=2
>
> ToyArray=array(1,dim=c(mat_size, mat_size, num_matrices, num_users))
> /* So I open an 4-dim array to store
Hi all,
I have a quick question regarding predictor variables in a GLMM analysis, a
subject I am new to.
I am running a study investigating multi-modal communication in primates.
specifically, primate gestures that accompany vocalizations.
I have measured the call rate, call duration and peak fr
Yes it should look like that... what i am doing is a variogram fit . But the
data of course are spread almost all over.. I would guess might be problem
with the data only?
--
View this message in context:
http://r.789695.n4.nabble.com/nls-singular-gradient-as-always-tp4669859p4669898.html
Sent
knitr is not tied to RStudio, and I believe this StackOverflow post
can answer your question: http://stackoverflow.com/q/10646665/559676
Regards,
Yihui
--
Yihui Xie
Phone: 206-667-4385 Web: http://yihui.name
Fred Hutchinson Cancer Research Center, Seattle
On Wed, Jun 19, 2013 at 4:42 AM, Ista Z
as.numeric(x1 == 1 | x2 == 1 | x3 == 1 | x4 == 1)
On Wed, Jun 19, 2013 at 9:24 AM, Brian Perron wrote:
> Greetings:
>
> I am looking for a way to avoid using the ifelse function for
> constructing a new variable. More specifically, assume I have a set
> of variables with scores ranging from 1 t
It's hard to say without seeing the data. It could be the data, it could
be the starting values, it could be the model choice.
Jean
On Wed, Jun 19, 2013 at 10:45 AM, pakoun wrote:
> Yes it should look like that... what i am doing is a variogram fit . But
> the
> data of course are spread almo
On Wed, 19 Jun 2013, Brian Perron writes:
> Greetings:
>
> I am looking for a way to avoid using the ifelse function for
> constructing a new variable. More specifically, assume I have a set
> of variables with scores ranging from 1 to 30.
>
> set.seed(12345)
> x <- c(1:30)
> x1 <- sample(x, 15,
On Jun 19, 2013, at 8:24 AM, Brian Perron wrote:
> Greetings:
>
> I am looking for a way to avoid using the ifelse function for
> constructing a new variable. More specifically, assume I have a set
> of variables with scores ranging from 1 to 30.
>
> set.seed(12345)
> x <- c(1:30)
> x1 <- sam
On Jun 19, 2013, at 8:24 AM, Brian Perron wrote:
> Greetings:
>
> I am looking for a way to avoid using the ifelse function for
> constructing a new variable. More specifically, assume I have a set
> of variables with scores ranging from 1 to 30.
>
> set.seed(12345)
> x <- c(1:30)
> x1 <- sam
On Jun 19, 2013, at 1:23 PM, Marc Schwartz wrote:
>
> On Jun 19, 2013, at 8:24 AM, Brian Perron wrote:
>
>> Greetings:
>>
>> I am looking for a way to avoid using the ifelse function for
>> constructing a new variable. More specifically, assume I have a set
>> of variables with scores rangi
On Jun 19, 2013, at 1:23 PM, Marc Schwartz wrote:
>
> On Jun 19, 2013, at 8:24 AM, Brian Perron wrote:
>
>> Greetings:
>>
>> I am looking for a way to avoid using the ifelse function for
>> constructing a new variable. More specifically, assume I have a set
>> of variables with scores rangi
Hi,
May bet this also helps:
set.seed(12345)
x <- c(1:30)
x1 <- sample(x, 15, replace = TRUE)
x2 <- sample(x, 15, replace = TRUE)
x3 <- sample(x, 15, replace = TRUE)
x4 <- sample(x, 15, replace = TRUE)
indx<-1+2*(x1==1)+4*(x2==1)+8*(x3==1)+16*(x4==1)
as.numeric(indx!=1)
#[1] 0 1 0 0 0 0 0 0 0 0 0
HI Burnette,
As this is continuation of the earlier thread, you could post it on the same
thread by cc: to rhelp.
Try this:
res1<-sapply(vec3,function(x) length(vec2New[grep(x,vec2New)]) )
dat1<-data.frame(res1,Name=names(vec3))
dat1$Name<-factor(dat1$Name,levels=c("early","mid","late","wknd")
You need to remove out.extra='style="display:block; margin: auto"'. In
CSS, display:block; means this element stands in its own line, and no
other elements can sit by its side. This is applied to individual
images, so the two images will not be arranged side by side.
But you will lose the center a
Wrong list -- Your question is not about R.
Post on a statistics list like stats.stackexchange.com
-- or better yet, consult a local statistician for guidance.
Cheers,
Bert
On Wed, Jun 19, 2013 at 8:44 AM, Bruce Rawlings wrote:
> Hi all,
>
> I have a quick question regarding predictor variables
On 19/06/13 23:24, R. Michael Weylandt wrote:
On Wed, Jun 19, 2013 at 12:04 PM, Yanyuan Zhu wrote:
Hello all, now I'm trying to switch from Excel to R to deal with the data,
and as a newbie i got the problem as follows.
suppose I have a data named "test"
test<- data.frame(year=c(1996:2011),
Y=
Dear Rxperts,..
I am using R 3.0 in both 32- and 64-bit Windows 7 environment and have
trouble using SASxport. They seem to work fine under R.2.15.3.
The error/warning messages are provided below...
Following are the messages obtained when trying to read s SAS transport
file (.xpt)
library
I am writing a function and I would like to return the name of a data frame
in a paste call, but I can't figure out how to just get the name. The names
of the data frames used, won't be the same each time. I have to be
overlooking the obvious.
#For example:
a<-replicate(5, rnorm(20))
b<-replicat
'a' and 'b' are vectors of length 100, so the sum of them would also
produce a vector of 100. So in one case, your code should look like this:
> a<-replicate(5, rnorm(20))
> b<-replicate(5, rnorm(20))
>
> xyz<-function(x,y){
+ z<-x+y
+ print(paste("the sum of", x, "and", y,"is", z, sep=" "))
Hi,
May be this helps:
xyz<-function(x,y){
z<-x+y
print(paste("the sum of", deparse(substitute(x)), "and",
deparse(substitute(y)),"is", sep=" "))
z
}
xyz(a,b)
[1] "the sum of a and b is"
[,1] [,2] [,3] [,4] [,5]
[1,] -1.38805146 -1.15706888 -1.0942
On Jun 19, 2013, at 6:27 PM, jim holtman wrote:
> 'a' and 'b' are vectors of length 100, so the sum of them would also
> produce a vector of 100.
Just to (hopefully) clarify, R code `sum(z)` would be a vector of length:1 but
`z` which is _not_ `sum(z)` but rather `x+y` would be length:100.
Great, that is exactly what I am looking for.
On Wed, Jun 19, 2013 at 9:39 PM, arun wrote:
> Hi,
> May be this helps:
>
> xyz<-function(x,y){
> z<-x+y
> print(paste("the sum of", deparse(substitute(x)), "and",
> deparse(substitute(y)),"is", sep=" "))
> z
> }
>
> xyz(a,b)
> [1] "the sum of
On 19 June 2013 09:26:30 David Carlson wrote:
> Perhaps you are talking about the variable.labels attribute returned
> by read.spss in package foreign?
That is it. I'll try it
Thanks
Lívio Cipriano
__
R-help@r-project.org mailing list
https://stat.et
On 19 June 2013 09:26:30 David Carlson wrote:
> variable.labels attribute returned
> by read.spss in package foreign? If so, you should try the
> attributes() or the attr() function:
Hi,
I used
attr(test,"variable.labels")[i][1]) and it worked.
Thanks
Lívio Cipriano
_
Hello R experts,
I want to add some extra words to number to existing column header. Can
anybody tell me how to do that.
e.g. if I have a data.frame
Height.1 Height.2 Height.6 Height.8 Height.10 Height.11 Height.17
Height.20 Height.22 Height.31
MBR174 720 104
Hello,
What did you try to do by yourself before to ask?
Regards,
Pascal
On 20/06/13 13:56, Suparna Mitra wrote:
Hello R experts,
I want to add some extra words to number to existing column header. Can
anybody tell me how to do that.
e.g. if I have a data.frame
Height.1 Height.2 He
Hello,
I
was trying ways to define new column names. Or very traditional way to
export the data and add names in excel.
But thought there must a way, but searched with several key words in
forum, but couldn't find the exact what I mean.
May be my search terms are not perfect.
Thanks,
Mitra
On
Hello,
Two keywords: "colnames" and "paste".
Regards,
Pascal
On 20/06/13 14:09, Suparna Mitra wrote:
Hello,
I
was trying ways to define new column names. Or very traditional way to
export the data and add names in excel.
But thought there must a way, but searched with several key words in
f
76 matches
Mail list logo