Hi
Your data came scrambled as you in contrary to advice post in HTML. So it is
just a guess but maybe you want
library(reshape)
melt(dat, id=c("Year", "Day"))
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of dila radi
You are the best. Thanks tons:))
Regards, Farnoosh Sheikhi
On Thursday, February 27, 2014 10:37 PM, arun wrote:
Hi Farnoosh,
YOu can try:
DataA$percent <- with(DataA,round((Var2/sum(Var2))*100,2))
library(ggplot2)
ggplot(DataA,aes(x=Var1,y=percent))+geom_bar(stat="identity",aes(fill=V
Hi Farnoosh,
YOu can try:
DataA$percent <- with(DataA,round((Var2/sum(Var2))*100,2))
library(ggplot2)
ggplot(DataA,aes(x=Var1,y=percent))+geom_bar(stat="identity",aes(fill=Var1))+geom_text(label=paste0(DataA$percent,"%"),vjust=-0.2,size=4)
A.K.
On Thursday, February 27, 2014 5:02 PM, farn
I had tried a little weird way of accessing symbols from "YAHOO.FINANCE" in
my GUI which is made in gwidgets ...Here is an example:--
tbl[5,1]=glabel("ENTER SYMBOL:-",cont=tbl)
tbl[5,2]=gedit("", cont=tbl,coerce.with=as.character)
BSS<-function(h,...)
{
options(guiToolkit="RGtk2")
data <- new
On Feb 27, 2014, at 7:24 PM, dila radi wrote:
> Hi all,
>
> I know this is easy, but I really do not have any idea to solve it.
>
> I have this kind of data set:
>
> dat <- read.table(text="Day Year Jan Feb Mar Apr
> 1 2012 0 2.5 0.5 2
> 2 2012 0 6.5 0 29
> 3 2012 0 9.5 0 0
> 4 2012 0
Dear all,
I did a 5-repeat of 10-fold cross validation using partial least square
regression model provided by caret package. Can anyone tell me how are the
values in plsTune$resample calculated? Is that predicted on each hold-out
set using the model which is trained on the rest data with the opti
On Feb 27, 2014, at 9:55 PM, Bert Gunter wrote:
> 1. I don't think this is the right way to go about this. I would think
> about making pieces of your title arguments and assembling them in
> your call.
>
> ... But be that as it may...
>
> 2. The problem is that in your loop, ii is already an e
1. I don't think this is the right way to go about this. I would think
about making pieces of your title arguments and assembling them in
your call.
... But be that as it may...
2. The problem is that in your loop, ii is already an expression -- a
language object. Pasting to it is meaningless. S
I successfully downloaded and loaded the stockPortfolio and quadprog packages,
but when I entered the following command I got an error:
returns <- getReturns(names(stocks), freq="week")
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") : can
Hi all,
I know this is easy, but I really do not have any idea to solve it.
I have this kind of data set:
dat <- read.table(text="Day Year Jan Feb Mar Apr
1 2012 0 2.5 0.5 2
2 2012 0 6.5 0 29
3 2012 0 9.5 0 0
4 2012 0 0 8 0.5
5 2012 0 5 0.5 110.5
6 2012 0 4 3.5 22
7 2012 11
Hi!
I am trying to fit 2-dimensional data (global data with 2-degree
resolution) using nls.lm function of minpack.lm package. I am successful to
fit the transient data in a single grid point but not able to fit 2-D data.
The error message is listed below. I am just wondering if anybody has used
th
Hi,
Both your code and my code work when I don't combine things. The
problem is when I want to combine an expression (or a bquote in your
example) with something else
e.g. this doesn't work:
vectorA = c( bquote("TNF-"*alpha), bquote("IFN-"*gamma) )
for(ii in vectorA) {
plot(0:1,0:1)
Yes, plotmath contains expressions. The example produced in ?plotmath is
not as complex as the example I provided. bquote and substitute allow
substitutions of variables ... but what I need to be able to do is
substitute an expression... and that is the magic I'm looking for.
thanks, Daryl
The R Inferno advises that if you are building up results in pieces it's
best to pre-allocate the result object and fill it in. In some testing,
I see a benefit with this strategy for regular variables. However, when
the results are held by a class, the opposite seems to be the case.
Comments?
On 02/28/2014 11:19 AM, David Parkhurst wrote:
I would like to plot three graphs, one above the other, of three “y”
variables that have different scales against a common Date variable, as
with the code below.
Q1. If I understand correctly, I can't use lattice graphics because my
y's have differe
On Feb 27, 2014, at 3:17 PM, Bert Gunter wrote:
> ?plotmath
>
> -- Bert
Daryl;;
I think what Bert was hoping you would do was read the plotmath page and figure
it out on your own but that can be a bit tricky when working with expression
object vectors. Here is (perhaps) a step forward:
vec
Hello,
Maybe functions "xts", "endpoints" and "period.apply" of the "xts"
package might help you.
Regards,
Pascal
On Fri, Feb 28, 2014 at 1:32 AM, Yang Yang wrote:
> Hi
>
> Currently I am working on a river discharge data analysis. I have the daily
> discharge record from 1935 to now. I want t
On Thu, Feb 27, 2014 at 7:19 PM, David Parkhurst wrote:
> I would like to plot three graphs, one above the other, of three "y"
> variables that have different scales against a common Date variable, as with
> the code below.
>
> Q1. If I understand correctly, I can't use lattice graphics because m
I would like to plot three graphs, one above the other, of three “y”
variables that have different scales against a common Date variable, as
with the code below.
Q1. If I understand correctly, I can't use lattice graphics because my
y's have different scales. Is that correct? All the lattic
You posted in HTML (despite warnings in the Posting Guide that doing so might
create problems.) There are exclamation points at many places in the text that
appear in a plain-text view of your code. When I past the first section of
your code to my console I see a similar error message (just sni
?plotmath
-- Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch
On Thu, Feb 27, 2014 at 2:58 PM, Daryl Morris wrote:
> Hi,
>
> I have a function which generates
Hi,
I have a function which generates many plots. To keep it simple, let's
say I want to set the main title based on where we are in nested loops.
So, something like
vectorA = c("a","b","c")
vectorB = c("a","b","c")
for(ii in vectorA) { for(jj in vectorB) {
plot(0:1,0:1)
title(main = pa
Incidentally,
?scales::percent
brings up exactly the same text as
?scales::percent_format
On 2014-02-27 Thu 14:47, Jacob Wegelin wrote:
But percent_format() does not take the argument, multiply it by 100, and
paste on a percent sign, as we see here:
?scales::percent_format
percent_format(
But percent_format() does not take the argument, multiply it by 100, and paste
on a percent sign, as we see here:
?scales::percent_format
percent_format(0.0101010101)
Error in percent_format(0.0101010101) : unused argument(s) (0.0101010101)
args(percent_format)
function ()
NULL
And how do
Hello,
I have written an user-defined split function for the package rpart, now I
want to prune the fitted tree with my own defined function.
To do so I want at first to grow a large tree with rpart and then use the
function to prune the tree.
The problem here is, growing a large tree with the use
Hi
Currently I am working on a river discharge data analysis. I have the daily
discharge record from 1935 to now. I want to extract the annual maximum
discharge for each hydrolocial year (*start from 01/11 to next year 31/10*).
However, I found that the hydroTSM package can only deal with the natu
On 27-02-2014, at 13:22, klq...@mail.bg wrote:
>
>
>
> Dear R users,
>
>
> I have to find optimal solution of an underdetermined linear system, but
> only with positive variables. I tried the function from this post
> https://stat.ethz.ch/pipermail/r-help/2007-October/143408.html , but it's
> "MM" == Mitchell Maltenfort
> on Thu, 27 Feb 2014 10:34:00 -0500 writes:
MM> "Convolve" uses the FFT so probably expects powers of 2.
Not quite (but in the correct direction):
?fft contains
The FFT is fastest when the length of the series being transformed
is highl
You have discovered two features of R with your example. Don
told you about the first. Data frames are considered to be lists
so if you provide only one index, you get the columns (the list
elements) when you type
> str(leadership)
'data.frame': 5 obs. of 10 variables:
$ manager: num 1 2 3 4
On 27/02/2014 17:09, David Parkhurst wrote:
I’d like to control the number of tick marks on the “x” axis of a plot,
when the variable there is dates. I thought to use the xaxp parameter,
but the documentation for par says “It [i.e., xaxp] is only relevant to
default numeric axis systems, and not
> Gunther Schauberger
> on Thu, 27 Feb 2014 16:20:36 +0100 writes:
> Hello,
> recently I submitted a new version of my package EffectStars to CRAN,
> but I was told that the following note arises:
> * checking CRAN incoming feasibility ... NOTE
> Maintainer: ‘Gun
I’d like to control the number of tick marks on the “x” axis of a plot,
when the variable there is dates. I thought to use the xaxp parameter,
but the documentation for par says “It [i.e., xaxp] is only relevant to
default numeric axis systems, and not for example to dates.” My
question, then
scales::percent appears not to be documented.
Details:
At http://cran.r-project.org/web/packages/scales/scales.pdf, equivalently in
?percent, I find no answer to the following two questions.
(1) How can I specify the number of decimal points in a call to percent()? For
instance, 0.010101 cou
> Error in as.POSIXlt.character(as.character(x), ...) :
> character string is not in a standard unambiguous format.
That error occurs when as.POSIXlt is looking for a format
with which to parse the strings. If you supply a format for the
date then as.POSIXlt will not give this error - it will j
Dear Beata,
how do you try to load the data? Copy-pasting that amount of characters
into the R console might now work due to size limitations of the clipboard.
Or do you get this error when calling "source" on the file?
Best,
Gergely
--
Sent from my Android phone with K-9 Mail. Please excuse my
Try a simpler example:
> ick <- data.frame(x=1:5, a=letters[1:5], c=month.abb[1:5], y=11:15)
> ick
x a c y
1 1 a Jan 11
2 2 b Feb 12
3 3 c Mar 13
4 4 d Apr 14
5 5 e May 15
> ick[2]
a
1 a
2 b
3 c
4 d
5 e
>
> ick[3]
c
1 Jan
2 Feb
3 Mar
4 Apr
5 May
If you use [] without a comma, it retur
Hi,
Thanks for the example!
I cannot really tell you why you get what you get when you type
leadership[leadership$country == "US"]
But what I know (or think I know) is that when you don't write the
comma, R will take it as a condition for the columns.
It means that leadership[1:2] is identi
Dear R-users,
I would like to load into R a data.frame which record size is 2000.
And I got an error message:
>
daaa$freq<-c(255899,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,32,34,36,38,40,42,23,25,27,29,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64
"Convolve" uses the FFT so probably expects powers of 2.
You might want to look at using "filter"
Ersatzistician and Chutzpahthologist
I can answer any question. "I don't know" is an answer. "I don't know
yet" is a better answer.
On Thu, Feb 27, 2014 at 5:31 AM, Phi
Hello,
recently I submitted a new version of my package EffectStars to CRAN,
but I was told that the following note arises:
* checking CRAN incoming feasibility ... NOTE
Maintainer: ‘Gunther Schauberger
’
Can you pls remove the line break in the DESCRIPTION file?
There is clearly no line br
Hello,
i am trying to compute the linear convolution of two vectors of length
1e7 each.
The code i am using is
a = vector(length=1e7)
b = vector(length=1e7)
#fill a and b with data...
c = convolve(a, rev(b), type="o")
Unfortunately, this computation goes on now for a very long time
(currently
Hi,
I have a dichotomous data where some my independent variables are categorical,
some are continuous and some are binary(0/1)
My dependent is a binary response (Fail/NoFail,0/1) .
The data is some readings collected everyday over a period of time.
The goal is to use this data and see if we c
Many thanks indeed.
But I foud a way.
It is worth of trying
http://www.davidbaumgold.com/tutorials/wine-mac/
Best,
Amir
On Monday, February 24, 2014 10:32 AM, "jlu...@ria.buffalo.edu"
wrote:
1. To install and run WBugs or Obugs on
OSX you must use Parallels or other Windows emulator.
Dear R users,
I have to find optimal solution of an underdetermined linear system, but
only with positive variables. I tried the function from this post
https://stat.ethz.ch/pipermail/r-help/2007-October/143408.html , but it's
solution includes also negative values.
Thanks in advance.
Bes
All - firstly apology if this is a very basic question but i tried myself
and could not find a satisfied answer.
I know that i can subset a dataframe using dataframe[row,column] and if i
give dataframe[row,] that specific row is provided and similarly i can do
dataframe[,column] to get the entire
I`m using fitdistr() to estimate parameters for different distributions of my
data set.
Now I have problems to estimate the weibull Distribution and others. I found
the recommendation to use the pel…() function.
My question is: If I estimate parameters with the pel…() function. How can I
use them
Here, here.
John Kane
Kingston ON Canada
> -Original Message-
> From: 538...@gmail.com
> Sent: Wed, 26 Feb 2014 10:07:12 -0700
> To: j...@mail.bitwrit.com.au, achim.zeil...@r-project.org
> Subject: Re: [R] Plots with Y axis split into two scales
>
> I nominate the following for the for
On 27/02/2014 7:10 AM, Alexander Shenkin wrote:
Hi folks,
I'm interested in finding files by matching both filenames and
directories via regex. If I have:
dir1_pat1/file1.csv
dir2_pat1/file2.csv
dir2_pat1/file3.txt
dir3_pat2/file4.csv
I would like to find, for example, all
Hi folks,
I'm interested in finding files by matching both filenames and
directories via regex. If I have:
dir1_pat1/file1.csv
dir2_pat1/file2.csv
dir2_pat1/file3.txt
dir3_pat2/file4.csv
I would like to find, for example, all csv files in directories that
have "pat1" in their
This is not the correct list: see the posting guide.
Two comments:
1) The messages are about C++ constructs, and toms708.c is a C file.
Perhaps you need to specify C explicitly (even though for a reasonable
compiler -std=c99 does that).
2) The lines highlighted refer to 'L40'. Perhaps some
Hi Dila,
Try:
transform(melt(dat,id.var=c("Day","Year")),Month=match(variable,month.abb),Amount=value)[,-c(3:4)]
A.K.
On Thursday, February 27, 2014 1:02 AM, dila radi wrote:
Dear Arun,
Thank you so much for your help..but this command doesn't apply if I have more
than one id. variables
Hi,
Try:
dat <- read.table(text="ID ONE TWO THREE
1 2 5 7
2 6 NA NA
3 5 7 NA
4 1 NA NA",sep="",header=TRUE)
dat1 <- dat
#Either:
dat$MAX <- apply(dat[,-1],1,max,na.rm=TRUE)
#or
dat1$MAX <- do.call('pmax',c(dat1[,2:4],list(na.rm=TRUE))
Maybe this can be of some help.
http://r.789695.n4.nabble.com/Fit-a-sine-to-data-td859118.html
Regards
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of chiara.maglio...@libero.it
> Sent: Wednesday, February 26, 2014 5:4
Thanks for the help.
problem is solved. :-)
--
View this message in context:
http://r.789695.n4.nabble.com/find-max-value-in-different-columns-tp4685905p4685912.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org ma
Hi
if I name your data frame to YDF
apply(YDF, 1, max, na.rm=FALSE)
shall find row max values. Jyst add them as new column.
Regards
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Mat
> Sent: Thursday, February 27, 2
55 matches
Mail list logo