On 3/30/2015 12:30 PM, T.Riedle wrote:
Hi,
I am struggling with following function
phi <- function(w1, w2, j, k, K){
+ zaehler <- (k/K)^(w1-1)*(1-k/K)^(w2-1)
+ nenner <- sum( ((1:K)/K)^(w1-1)*(1-(1:K)/K)^(w2-1))
+ return( zaehler/nenner )
+ }
phi(c(1, 1), 44L, 1)
Error in phi(c(1, 1), 4
This is no better because (a) you are still posting using HTML format, and (b)
using printed output loses the internal representation of the data. The dput
function is very helpful for solving this. [1]
[1]
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
--
Hi Stephen,
Sorry, the data came in bad way.
Here is the head of the data.
> head(data)Date Number.of.Rain.Days Total.rain Start.of.Rain..i.
> Start.of.Rain..ii. Start.of.Rain..iii. Start.Rain..iv.
1 1952-01-01 86 1139.95292
239 11
David Villegas Ríos gmail.com> writes:
> Hi,
> For a number of individuals, I have measured several behavioral traits in
> the wild. Those traits (e.g. home range) can be estimated on different
> temporal scales, for example daily, weekly or monthly. I want to estimate
> repeatability of those tr
Hi,
On Mar 30, 2015, at 9:15 PM, Doran, Harold wrote:
> I�m struggling a bit with learning about POSIX objects to do some basic
> things with objects of this class. Suppose I have the following simple example
>
> times <- c("03:20", "29:56", "03:30", "21:03", "56:26")
>
> aa <- strptime(time
Hi,
I am struggling with following function
> phi <- function(w1, w2, j, k, K){
+ zaehler <- (k/K)^(w1-1)*(1-k/K)^(w2-1)
+ nenner <- sum( ((1:K)/K)^(w1-1)*(1-(1:K)/K)^(w2-1))
+ return( zaehler/nenner )
+ }
> phi(c(1, 1), 44L, 1)
Error in phi(c(1, 1), 44L, 1) : argument "k" is missing, with no
Hi everybody,
Does anybody have an idea how I can generate tau according to the attached
formula? The point is that phi changes with k and I thought I could make it by
using a for-function in R but I am not sure how to do that.
Could anyone help me?
Thanks in advance.
__
Hi John,
What happens is that you have passed two named arguments to your function
"myfun" along with the matrix "data". Because these arguments have
associated values ("delta", "SE"), these values are substituted into the
expression like this:
x["delta"]/x["SE"]
which is the return value of "myf
> I can't understand how the body of the function, x[c1]/x[c2] refers to
the columns "data" and "SE" of the matrix data.
If you put the line 'str(x)' at the start of myfun(), as in
myfun <- function(x, c1, c2) {
str(x)
x[c1]/x[c2]
}
you would start to see why it works - extractin
On Tue, Mar 31, 2015 at 01:15:09AM +, Doran, Harold wrote:
> I?m struggling a bit with learning about POSIX objects to do some basic
> things with objects of this class. Suppose I have the following simple example
>
> times <- c("03:20", "29:56", "03:30", "21:03", "56:26")
>
> aa <- strptime
You seem to be trying to make POSIXt into something it isn't, as though this
was Excel.
First, POSIXt is not the same as numeric. You can convert between them, but
they are not the same. If you want to do numeric operations, convert.
Second, POSIXt is not time of day only. When you provide onl
Hi Alexandra,
This produces a rather messy plot, but it might get you started:
finalData<-data.frame(ws=sample(0:100,1300,TRUE),
stn=rep(1:13,each=100),hour=rep(1:24,length.out=1300))
statHour = tapply(finalData$ws,list(finalData$stn,finalData$hour),sd)
# open a wide device
x11(width=13)
# leave
Colleagues,
I am trying to understand the syntax of a function passed to apply. The code
below generates a matrix, and passes the matrix to a function that is called by
apply. I don't understand the syntax of the function. In some way the function
computes data[,"delta"]/data[,"SE"]. I can't und
I�m struggling a bit with learning about POSIX objects to do some basic things
with objects of this class. Suppose I have the following simple example
times <- c("03:20", "29:56", "03:30", "21:03", "56:26")
aa <- strptime(times, "%M:%S�)
I can do means, and some other basic things, but I cannot
I am analyzing trend test using Mann-kendall monotonic trendtest for 10,368
independent grid cell, each grid has 34 years dataset. I supposed to find
Kendall “tau” for each gridcell (each grid has 34 years data). The data is
arranged in column wise (Iattached part of the grid dataset as a sam
Hello,
I am trying to plot the hourly standard deviation of wind speeds from
13 different measured locations over many years. I imported the data
using readLines and into a dataframe called finalData. Using tapply, I
determined the standard deviation of the windspeed (ws) for each hour
(hour) from
Reproducible example???
cheers,
Rolf Turner
P.S. Where does "mlogit" come from? Note fortune(182).
R. T.
On 31/03/15 06:46, Ingrid Charvet wrote:
Hello,
When fitting a logit multinomial model with "mlogit" I can retrieve
the response probabilities using fit$fitted.values (for a given
ob
On 30/03/2015 1:50 PM, Keith S Weintraub wrote:
> Folks,
>
> I would like change some of the options for the Tk window that pops up when
> using the debug package.
>
> I know how to change the options: e.g. options(debug.font = "Courier 12
> italic”).
>
> Is there a way to “preset” these in my
Folks,
I would like change some of the options for the Tk window that pops up when
using the debug package.
I know how to change the options: e.g. options(debug.font = "Courier 12
italic”).
Is there a way to “preset” these in my environment so when debug starts up I
have all the options set u
Hello,
When fitting a logit multinomial model with "mlogit" I can retrieve the
response probabilities using
fit$fitted.values (for a given object "fit")
However, I am trying to calculate those response probabilities myself using the
maximum likelihood estimates (i.e. fit$coefficients) given by
Regarding the averages, someone else mentioned that it's preferred to
start a new question in a new post to the list.
That said, you are confusing "inside" the list with "outside" the list.
Try this:
(the following R expression is supposed to be all on one line, but my
email software may cause a
My error is Mac because I don't use R-Studio. The phrasing of Ian's
error is similar to the error I reported
and still occasionally get. As I said, it is random and therefore not
reproducible.
This is consistent with the comments on the rstudio link you pointed us to.
Rich
On Mon, Mar 30, 2015
On 30 March 2015 at 17:50, Sarah Goslee wrote:
> On Mon, Mar 30, 2015 at 11:43 AM, Sven E. Templer
> wrote:
> >
> >
> > On 30 March 2015 at 17:31, Bert Gunter wrote:
> >>
> >> Sarah's statement is correct.
> >>
> >> So is yours. They are not contradictory, and I believe Sarah's point
> >> was t
On Mon, Mar 30, 2015 at 11:43 AM, Sven E. Templer
wrote:
>
>
> On 30 March 2015 at 17:31, Bert Gunter wrote:
>>
>> Sarah's statement is correct.
>>
>> So is yours. They are not contradictory, and I believe Sarah's point
>> was that the OP needed to learn the appropriate syntax.
>>
>
> That's why
Sorry, I failed to cc the list.
-- Bert
-- Forwarded message --
From: Bert Gunter
Date: Mon, Mar 30, 2015 at 8:36 AM
Subject: Re: [R] changing column labels for data frames inside a list
To: Vikram Chhatre
You really really need to spend (more?) time with a good R tutorial
On 30 March 2015 at 17:31, Bert Gunter wrote:
> Sarah's statement is correct.
>
> So is yours. They are not contradictory, and I believe Sarah's point
> was that the OP needed to learn the appropriate syntax.
>
>
That's why I pointed to ?return.
Sarah's statement was not so clear (and might have
Hi all,
I frequently use Vennerable to design diagrams of my data.
However, when I want to make a weighed diagram for a set of 4 samples, type
ChowRuskey, I get a nice view, but the font size of both numbers and sample
names is too small. Furthermore, the place of the sample names isn't always
tha
On 30 March 2015 at 17:19, Vikram Chhatre wrote:
> First of all, thank you for all the quick replies. Here is a solution that
> worked for me.
>
> mylist2 <- lapply(mylist, function(e){colnames(e) <- paste0('pop',1:12);
> return(e)})
>
> > head(mylist2[[1]])
> pop1 pop2 pop3 pop4 pop
Sarah's statement is correct.
So is yours. They are not contradictory, and I believe Sarah's point
was that the OP needed to learn the appropriate syntax.
-- Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowledge
First of all, thank you for all the quick replies. Here is a solution that
worked for me.
mylist2 <- lapply(mylist, function(e){colnames(e) <- paste0('pop',1:12);
return(e)})
> head(mylist2[[1]])
pop1 pop2 pop3 pop4 pop5 pop6 pop7 pop8 pop9 pop10 pop11
pop12
L0001.1 0.60 0.500 0.
Dear R-usrs,
I am trying to perform a MANOVA on a data frame with 31 columns about soil
parameters and 1 column containing the explanatory variable (Fraction) that
have three levels.
my code is the following:
datam <- read.table("data_manova2.csv", header=T, sep=",")
names(datam)
manova_fraction
On 30 March 2015 at 16:47, Sarah Goslee wrote:
> colnames(e) <- paste0('pop',1:12)
>
> isn't a function and doesn't return anything.
>
But
function(e){colnames(e) <- paste0('pop', 1:2)}
is a function and it returns something (the last evaluated expression! -
here the paste0 return):
> mylist2 <
I am not sure it would do it since there is no reproducible example, but
try names() instead of colnames().
HTH,
Ivan
--
Ivan Calandra, ATER
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calan...@univ-reims.
Assuming that the elements of mylist are data frames, try this:
mylist <- lapply(mylist, function(e) { names(e) <- paste0('pop',1:12) ; e})
With certain exceptions, the result of a function is the result of the
last expression in the function body. As you defined it, the last
expression was
co
colnames(e) <- paste0('pop',1:12)
isn't a function and doesn't return anything.
> mylist <- list(
+ data.frame(a = runif(10), b = runif(10)),
+ data.frame(c = runif(10), d = runif(10)),
+ data.frame(e = runif(10), f = runif(10)))
> mylist2 <- lapply(mylist, function(e){colnames(e) <- paste0('pop'
In your first example you created logfat.lm and then tried to plot logfat so
you got an error indicating that logfat did not exist.
In your second example we have no idea what body.fat. You must make your
examples reproducible so that we can reproduce your error. It looks like you
could also b
I am working with a circular data ( wind direction ) and i have problem
in transforming the circular variable into linear variable. I have found
an equation that can be used to convert the circular variable into linear
variable which is included in this paper *" ARMA based approaches for
forecasti
Hi Frederic,
Can you provide a minimal reproducible example including either real data
(dput), or simulated data that mimics your situation? This will allow more
people to help.
Stephen
On Mon, Mar 30, 2015 at 8:39 AM, Frederic Ntirenganya
wrote:
> Dear All,
>
> I want to plot multiple using g
On Mon, Mar 30, 2015 at 1:59 AM, Ian Lester wrote:
> i have no idea what to do
One of the other responses already told you it was probably an Rstudio
problem, so not using Rstudip seems like a good place to start.
Sarah
>
>> plot(body.fat, BMI,xlab="Body fat",ylab="BMI",main=“Figure 2.1: BMI vs
Thanks a lot for the answer and I'm sorry for the silly question!
Also thanks for the conceptual advice! It was also a doubt of me and my
advisors.
Best!
2015-03-28 15:17 GMT-03:00 John Fox :
> Dear Rodolfo,
>
> Sending the data helps, though if you had done what I suggested, you would
> have
* Hi,
** I'm dealing with wind data and I'd like to model their**
distribution.** Wind** direction *
* are typically following a vonmises distribution and wind speeds
**follow a weibull distribution. I'd like to build a joint**
distribution** of directions and speeds as a VonMises-Weibull
bivariate
i have no idea what to do
> plot(body.fat, BMI,xlab="Body fat",ylab="BMI",main=“Figure 2.1: BMI vs Body
> fat (n=252)”)
Error: unexpected input in "plot(body.fat, BMI,xlab="Body
fat",ylab="BMI",main=�"
> plot(body.fat, BMI,xlab="Body fat",ylab="BMI")
serious error. This application, or a librar
> summary(mygenfreqt)
Length Class Mode
dat1.str 59220 -none- numeric
dat2.str 59220 -none- numeric
dat3.str 59220 -none- numeric
> head(mylist[[1]])
1 2 3 4 5 6 7 8 91011
12
L0001.1 0.60 0.500 0.325 0.675 0.600 0.500 0.500
Your function phi has 5 arguments with no defaults. Your call only has 3
arguments. Hence the error message.
> phi <- function(w1, w2, j, k, K){
+ zaehler <- (k/K)^(w1-1)*(1-k/K)^(w2-1)
+ nenner <- sum( ((1:K)/K)^(w1-1)*(1-(1:K)/K)^(w2-1))
+ return( zaehler/nenner )
+ }
> phi(c(1, 1), 44
Miguel,
Sin tus datos es imposible brindarte una respuesta precisa pero ten en cuenta
que la descripción del argumento 'fórmula' en la función tree del paquete del
mismo nombre dice que la variable dependiente -PRECIO en tu caso- debe ser un
vector numérico si quieres estimar un árbol de regre
Sorry if that's confusing: I'm probably confused. :-(
I am collecting and trying to analyze data regarding performance of
computer systems.
After extracting the data from its repository, I have created and
used a Perl script to generate a (relatively) simple CSV, each
record of which contains:
*
Dear All,
I want to plot multiple using ggplot function from a data frame of
many columns. I want to plot only str1, str2 and str3 and I failed to
make it. What I want is to compare str1, str2 and str3 by plotting
vertical line. I also need to add points to the plot to be able to
separate them.
Rich,
You’ve probably reported the error to the wrong group.
A quick search suggests this is not an R issue, but an RStudio issue. The error
message is unique enough. Google returns this as the first link:
https://support.rstudio.com/hc/communities/public/questions/200807456-Error-when-plotting
We need enough information to run your code on our computer and get the
same error as you. In this case we are missing the data. See e.g.
http://adv-r.had.co.nz/Reproducibility.html If you can't provide the
original data, then try to make a (small) example which reproduces your
problem.
ir. Thierr
Dear Thierry Onkelinx,
Thank you so much to answer me. But I do not know what information I should
send for you
I want to run neural network on my data.I run these codes and I saw this
Error in the last line
#load mydata
dim(mydata)
# 20 3111
library(neuralnet)
fm <- as.formula(paste("resp ~", pa
You should sent us a commented, minimal, self-contained, reproducible code
as the posting guide tells you to do.
Your code is not self-contained. So we can only speculate what when wrong.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Bi
Dear All,
I want to run neural network on my data.
i run these codes:
#load mydata
dim(mydata)
# 20 3111
library(neuralnet)
fm <- as.formula(paste("resp ~", paste(colnames(mydata)[1:3110],
collapse="+")))
out <- neuralnet(fm,data=mydata, hidden = 4, lifesign = "minimal",
linear.output = FALSE, t
Below is some working code that, generally speaking, accomplishes why I want,
but am looking for a necessary improvement in the final step. The code below
scrapes data from a website (thousands of pages actually) and organizes
athlete�s scores in a data frame. The final variable, called Workout0
> On 30 Mar 2015, at 09:59 , Stéphane Adamowicz
> wrote:
>
>
> However, in order to help me understand, would you be so kind as to give me a
> matrix or data.frame example where « complete.cases(X)== T » or «
> complete.cases(X)== TRUE » would give some unwanted result ?
The standard proble
> On 30-03-2015, at 09:59, Stéphane Adamowicz
> wrote:
>
>
> Le 27 mars 2015 à 18:01, David Winsemius a écrit :
>
>>
>> On Mar 27, 2015, at 3:41 AM, Stéphane Adamowicz wrote:
>>
>>> Well, it seems to work with me.
>>>
>>
>> No one is doubting that it worked for you in this instance. What
Le 27 mars 2015 � 18:01, David Winsemius a �crit :
>
> On Mar 27, 2015, at 3:41 AM, St�phane Adamowicz wrote:
>
>> Well, it seems to work with me.
>>
>
> No one is doubting that it worked for you in this instance. What Peter D. was
> criticizing was the construction :
>
> complete.cases(t(
Hi,
For a number of individuals, I have measured several behavioral traits in
the wild. Those traits (e.g. home range) can be estimated on different
temporal scales, for example daily, weekly or monthly. I want to estimate
repeatability of those traits, assuming that the daily/weekly/monthly
measur
57 matches
Mail list logo