Hi all,
I used both OpenBugs and R function bugs{R2WinBUGS} to run a linear mixed
effects model based on the same data set and initial values. I got the same
summary statistics but different posterior samples. However, if I order
these two sets of samples, one is generated from OpenBugs and the ot
I would like to execute a python script from R and receive the stdout in R. I
have windows xp and R 2.14.2. The test.py script should print "hello", it does
work in cmd. Here is a couple tries, thanks for any suggestions!John
> system('cmd test.py', intern = TRUE)[1] "Microsoft Windows XP [Vers
Hi,
"Yes, I wanted to expand directly from d. If there are other variables,
says "A", "B", "C" that I need to keep in the final expanded data, how
to modify the code?"
d<-data.frame()
for (m1 in 2:3) {
for (n1 in 2:2) {
for (x1 in 0:(m1-1)) {
for (y1 in 0:(n1-1)) {
d<-
Greetings,
I'm working on image classification and for that I want to use the spectral
slope as a feature for my classifier. For this I would prefer to calculate
this feature using R, so far I've read my image and converted it's RGB
representation into HSL. The spectral slope is computed over the
Hi, i am working in the forecast of the daily price crude .
The last prices of this data are the following:
100.60 101.47 100.20 100.06 98.68 101.28 101.05 102.13 101.70 98.27
101.00 100.50 100.03 102.23 102.68 103.32 102.67 102.23 102.14 101.25
101.11 99.90 98.53 96.76 96.12 96
I cannot imagine why you think this is the appropriate place to pose such a
question. It certainly has nothing to do with R (which would be appropriate),
and it does look like homework (which is identified as NOT appropriate in the
Posting Guide for this mailing list).
--
Hello R, could you explain to me how to resolve this question:
If this is a matrix:
Element S1 S2 S3 S4
001 01
101 00
210 01
300 10
400 11
510 00
1. How is possib
On 02/18/2013 02:03 AM, Benjamin Tyner wrote:
Thanks Jim -- I had considered this approach; is there any way to "hide"
such arguments from users?
Hi Ben,
I played around with your solution for a while and if the first argument
to the function changes with each recursive call, you may be able t
Hello,
As for the first question, you can do something like
Timeframemin<-10
Timefram<-1
uFrame <- seq(Timeframemin, Timefram, by = 10)
for(u in uFrame) {}
As for the second question, the answer is yes, there is a print()
function, which can be used for your purpose.
Hope this helps
I understand. I want to specify that drug is only a fixed factor and family
should be the only random factor. So maybe, my R code is wrong If I
specify random=~1|drug/family it is only because I wanted to specify that
family is nested within drug.
--
View this message in context:
http://r.7
Hi!
I'm finding this on MacOS Lion 10.7.5
> getOption("digits.secs")
NULL
> a <- "2012_10_01_14_13_32.445"
> strptime(a,format="%Y_%M_%d_%H_%M_%OS")
[1] "2012-02-01 14:13:32"
> strptime(a,format="%Y_%M_%d_%H_%M_%OS3")
[1] NA
I can solve it with
> options(digits.secs=3)
> strptime(a,format="%Y_%
Hi all,
I want to execute a loop of a program:
for (u in Timeframemin:Timeframe){}
Imagine that Timeframemin<-10
Timefram<-1
Is it posible to execute the loop but only proving from 10 to 1 but
jumping 10 each time, for example, execute for 10,20,30.to Timeframe.
Other question is,
Thanks! I will do the needful.
On Sun, Feb 17, 2013 at 3:32 PM, John Kane wrote:
> https://github.com/hadley/devtools/wiki/Reproducibility
>
> John Kane
> Kingston ON Canada
>
>
> > -Original Message-
> > From: t...@gurukuli.co.uk
> > Sent: Sun, 17 Feb 2013 07:50:17 +
> > To: r-help
Dear Elisa,
Try this:
vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45)
vec2<-vec1[1:26]
names(vec2)<-LETTERS[1:26]
label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x)
x),lapply(seq(5,50,5
HI Elisa,
You could use ?cut()
vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45)
label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x)
x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),
On 13-02-17 10:03 AM, Benjamin Tyner wrote:
Thanks Jim -- I had considered this approach; is there any way to "hide"
such arguments from users?
Don't export the recursive function, just a non-recursive function that
calls it.
Duncan Murdoch
Jim Lemon wrote:
On 02/17/2013 12:55 PM, Benjam
Hi: Like I said earlier, you really should read west and harrison first,
especially if you're
a beginner in bayesian methods. giovanni's book and package are both very
nice ( thanks giovanni ) but the book is more of a summary of west and
harrison and sort of assumes some familarity with the materi
thanks to all!
didn't know about simplify2array, nor about the abind package.
they're exactly what i wanted.
cheers,
-m
On Sun, Feb 17, 2013 at 9:41 AM, Tony Plate wrote:
> abind() (from package 'abind') can take a list of arrays as its first
> argument, so in general, no need for do.call() wit
On Feb 17, 2013, at 5:51 AM, Frans Marcelissen wrote:
> Let'say we have a dataframe mydata with column v1. If mydata$v1 is passed
> to a function, is there way, then, to extract the name of the dataframe?
> What I now do is passing the name of the dataframe to the funcion, so
> passing two parame
Homework? We don't do homework here.
-- Bert
On Sun, Feb 17, 2013 at 5:10 AM, Prakasit Singkateera
wrote:
> Hi Experts,
>
> I have a dataset of 3 columns:
>
> customer.name product cost
> John Toothpaste 30
> Mike Toothpaste 45
> Peter Toothpaste 40
>
> And I have
Will this work for you:
> myFunc <- function(var){
+ # get the dataframe name
+ charName <- deparse(substitute(var))
+ # parse out data.frame
+ dataFrame <- sub("\\$.*", "", charName)
+ cat("input:", charName, "data.frame:", dataFrame, "\n")
+ }
>
> myFunc(mydata$V1)
input: myd
melswed slu.se> writes:
>
> Hi,
>
> I am running a mixed-effect model with a nested-random effect. I am
> interested in gut parasites in moose. I has three different type of
> treatment that I applied to moose which are from different "families". My
> response variable is gut parasites and the
Hi,
I am not sure I understand it correctly.
dat1<-read.table(text="
customer.name product cost
John Toothpaste 30
Mike Toothpaste 45
Peter Toothpaste 40
",sep="",header=TRUE,stringsAsFactors=FALSE)
dat1$no.of.orders<- sqrt((dat1$cost-3.40)/1.20)
dat1
# customer.name
This sounds a bit too much like homework.
And in any case https://github.com/hadley/devtools/wiki/Reproducibility
John Kane
Kingston ON Canada
> -Original Message-
> From: asltjoey.rs...@gmail.com
> Sent: Sun, 17 Feb 2013 20:10:13 +0700
> To: r-help@r-project.org
> Subject: [R] How to
Hi,
I am running a mixed-effect model with a nested-random effect. I am
interested in gut parasites in moose. I has three different type of
treatment that I applied to moose which are from different "families". My
response variable is gut parasites and the factors are moose families which
is neste
Hi Gustav,
Just change `summary(x)$coef` to `summary(x)$p.table`
I am pasting the code from the attachment.
library(gamair)
library(mgcv)
data(chicago)
library(splines)
chicago$date<-seq(from=as.Date("1987-01-01"),
to=as.Date("2000-12-31"),length=5114)
chicago$trend<-seq(dim(chicago)[1
Dear R-Help Members,
I have built a classification function using a baseline data set, that contains
the group variable and have used it to classify the test data set. I am now
trying to get the classification table for the training and test data set and
classification success using:
baseline.
Sorry, I just noticed that in the first line of the solution 'l' got stripped
off, it should be read as 'lapply` instead of 'apply`.
lapply(1:length(models),function(i) lapply(models[[i]],function(x)
summary(x)$p.table[2,]))[[1]] #1st list component
Thanks,
A.K.
___
Let'say we have a dataframe mydata with column v1. If mydata$v1 is passed
to a function, is there way, then, to extract the name of the dataframe?
What I now do is passing the name of the dataframe to the funcion, so
passing two parameters. Maybe with mydata$v1 it is not possible, but with
mydata['
Hi Experts,
I have a dataset of 3 columns:
customer.name product cost
John Toothpaste 30
Mike Toothpaste 45
Peter Toothpaste 40
And I have a function of cost whereby
cost = 3.40 + (1.20 * no.of.orders^2)
I want to do a backward calculation for each records (each
Hi, i'm beginner in Bayesian methods, I'm reading the documentation about
dlm package and kalman filters, I'm looking for a example of transformation
of ARIMA in a state space equivalent to use the dlm package and calcualte
the hyperparameters. Someone can help me about it?. If it's possible with a
Hi, I am trying to make an automatic kriging interpolation algorithm.When I
use the fit.variogram function what would it be a good startingvalue for the
range?
ThanksDimitris
[[alternative HTML version deleted]]
_
https://github.com/hadley/devtools/wiki/Reproducibility
John Kane
Kingston ON Canada
> -Original Message-
> From: t...@gurukuli.co.uk
> Sent: Sun, 17 Feb 2013 07:50:17 +
> To: r-help@r-project.org
> Subject: [R] Multidimensional correlation matrix question
>
> Hello,
>
> I previous
Make the flag an attribute of the function? Unless the user looks at
the attributes, it will be "invisible."
(Not sure this does what you want, but maybe it's useful.)
-- Bert
On Sun, Feb 17, 2013 at 7:03 AM, Benjamin Tyner wrote:
> Thanks Jim -- I had considered this approach; is there any wa
Have you read "An Introduction to R" (ships with R) or made any other
minimal effort with a beginning R tutorial to learn the language?
Have you read the posting guide or any other previous posts to learn
how to post coherently -- a "small, reproducible example" would be
helpful, for instance.
It
Thanks Jim -- I had considered this approach; is there any way to "hide"
such arguments from users?
Jim Lemon wrote:
On 02/17/2013 12:55 PM, Benjamin Tyner wrote:
Given a function that calls itself, what's the best way to detect the
entry point? The best I came up with is:
IsEntryPoint <- fun
Am 27.01.2013 16:48, schrieb Duncan Murdoch:
> On 13-01-27 10:37 AM, Alexander Senger wrote:
>> Hello useRs,
>>
>>
>> I would like to draw a 3D-surface using rgl with a point-like
>> light-source within the scene, that is with finite distance of the
>> light-source to the surface to be lit.
>
> Th
abind() (from package 'abind') can take a list of arrays as its first argument,
so in general, no need for do.call() with abind().
As another poster pointed out, simplify2array() can also be used; while abind()
gives more options regarding which dimension is created and how dimension names
are
HI Vera,
No problem. I am cc:ing to r-help.
A.K.
From: Vera Costa
To: arun
Sent: Sunday, February 17, 2013 5:44 AM
Subject: Re: reading data
Hi. Thank you. It works now:-)
And yes, I use windows.
Thank you very much.
No dia 17 de Fev de 2013 00:44, "ar
Dear Barry,
I saw that you received several nice answers on how to 'pull out' numeric
columns. You also wrote that an alternative could be to 'just operate only on'
numerics. Here is one possibility:
library(plyr)
# some dummy data
df <- data.frame(nonnum1 = letters[1:5], num1 = 1:5, nonnum2
Hello,
I previously sent this message which was stripped off due to HTML mail. Sorry!
Thanks.
Hello All,
I am new to the list. I have been learning to use R recently and its been
great to see so much help available.
However I must admit, I have stumbled upon a problem with correlation
matrices
I am trying to learn to use winBUGS from R, I have experience with R.
I have managed to successfully run a simple example from R with no
problems. I have been trying to run the Leuk: Survival from winBUGS
examples Volume 1. I have managed to run this from winBUGS GUI with no
problems. My problem is
This function is separable.
If calculating by hand with bounds a <-0 and b <- 1 i got the result:
theta / kappa * ( 1 + exp( - kappa) / kappa - 1 / kappa)
by putting
theta <- 0.1
kappa <-0.3
in the above result I got 0.04535
I implemented it in R this way:
integrate(function(y) {
sapply(
On 17-02-2013, at 10:01, julia cafnik wrote:
> thank for your help. already solved it.
>
Show us how.
So that others looking for answers to similar problems in future can find an
answer.
Berend
__
R-help@r-project.org mailing list
https://stat.eth
thank for your help. already solved it.
Cheers,
J.
On Sun, Feb 17, 2013 at 9:41 AM, Berend Hasselman wrote:
>
> On 16-02-2013, at 18:01, julia cafnik wrote:
>
> > Dear R-users,
> >
> > I'm wondering how to calculate this double integral in R:
> >
> > int_a^b int_c^y g(x, y) dx dy
> >
> > wher
On 16-02-2013, at 18:01, julia cafnik wrote:
> Dear R-users,
>
> I'm wondering how to calculate this double integral in R:
>
> int_a^b int_c^y g(x, y) dx dy
>
> where g(x,y) = exp(- alpha (y - x)) * b
>
A very similar question was asked about nine years ago:
http://tolstoy.newcastle.edu.a
46 matches
Mail list logo