> y
[1] "$1,000.00 " "$1,000.00 " "$1,000.00 " "$2,600.00 " "$2,600.00 "
> gsub("$", "", y)
[1] "$1,000.00 " "$1,000.00 " "$1,000.00 " "$2,600.00 " "$2,600.00 “ #
no change. Why?
"$" as a regular expression means "end of string", which has zero length -
replacing "end
of string" with n
y <- as.numeric( gsub( "[$, ]", "", y ) )
--
Sent from my phone. Please excuse my brevity.
On February 10, 2016 9:39:16 PM PST, James Plante wrote:
>What I’ve got:
># sessionInfo()
>R version 3.2.3 (2015-12-10)
>Platform: x86_64-apple-darwin13.4.0 (64-bit)
>Running under: OS X 10.11.3 (El Capita
What I’ve got:
# sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.3 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets
Most of the mass of that distribution is within 3e-100 of 2.
You have to be pretty lucky to have a point in sequence
land there. (You will get at most one point there because
the difference between 2 and its nearest neightbors is on
the order of 1e-16.)
seq(-2,4,len=101), as used by default in cu
Hi Val,
Does this help:
library(plyr)
ddply(as.data.frame(xc3), .variables = "xc1", summarise, d1 = sum(xc2 ==
0), d2 = sum(xc2 == 1))
You could also try
aggregate(xc3, by = list(xc1, xc2), FUN = sum)
and modify the output.
Best,
Ulrik
On Thu, 11 Feb 2016 at 04:12 Val wrote:
> Hi all,
>
>
Hi all,
I want create a frequency table using this :
xc1<- sample(c(1:10), 100, replace = TRUE)
xc2<- sample(c(0,1), 100, replace = TRUE)
xc3<- cbind(xc1,xc2)
tab1<- xc3[,list( d1=sum(xc2==0), d2=sum(xc2==1)),by=xc1]
but not working.
Error in `[.data.frame`(xc3, , list(d1 = sum(xc2 == 1), d2
Dear R,
I am graphing the following normal density curve. Why does it look so
different?
# the curves
x <- seq(-2, 4, by=0.1)
curve(dnorm(x, 2, 10^(-100)), -4, 4) #right answer
curve(dnorm(x, 2, 10^(-100)), -3, 4) #changed -4 to -3, I get wrong answer
Why the second curve is flat? I just
Oh, you didn't say the intervals could overlap!
If Bill D's suggestions don't suffice, try the following:
(again assuming all dates are in a form that allow comparison
operations, e.g. via as.POSIX**)
Assume you have g intervals with start dates "starts" and end dates
"ends" and that you have d
You could try pulling some of the repeated subscripting operations,
especially the insertions, out of the loop. E.g.,
values <- observations[,"values"];
date <- observations[,"date"] ;
groups$average <- vapply(seq_len(NROW(groups)), function(i)
mean(values[date >= groups[i, "start"] &
Thanks David, Bert,
>From what I'm reading on ?findInterval, It may not be workable because
of overlapping date ranges. findInterval seems to take a series of
bin breakpoints as its argument. I'm currently exploring data.table
documentation and will keep thinking about this.
Just on David's poin
A strategy:
1. Convert your dates and intervals to numerics that give the days
since a time origin. See as.POSIXlt (or ** ct for details and an
example that does this). Should be fast...
2. Use the findInterval() function to get the interval into which each
date falls. This **is** "vectorized" a
> On Feb 10, 2016, at 12:18 PM, Peter Lomas wrote:
>
> Hello, I have a dataframe with a date range, and another dataframe
> with observations by date. For each date range, I'd like to average
> the values within that range from the other dataframe. I've provided
> code below doing what I would
Hello, I have a dataframe with a date range, and another dataframe
with observations by date. For each date range, I'd like to average
the values within that range from the other dataframe. I've provided
code below doing what I would like, but using a for loop is too
inefficient for my actual cas
On 10/02/2016 12:29 PM, Archbold Muhle wrote:
Kindly assist. I run the below command in Rstudio
> devtools::install_github("rstudio/addinexamples")
and get the following error
Downloading GitHub repo rstudio/addinexamples@masterfrom URL
https://api.github.com/repos/rstudio/addinexamples/zipball/
Dear all,
I am very sorry for this mistake (I will definetly remember the lesson!),
its now working with R latest version...
Thank you very much for your help and advices
Sarah
2016-02-10 18:27 GMT+01:00 Bert Gunter :
> Your R is quite old -- newest version is at least 3.2.3 . As a general
> rule
Kindly assist. I run the below command in Rstudio
> devtools::install_github("rstudio/addinexamples")
and get the following error
Downloading GitHub repo rstudio/addinexamples@masterfrom URL
https://api.github.com/repos/rstudio/addinexamples/zipball/masterError in
curl::curl_fetch_memory(url, han
The Posting Guide mentioned at the bottom of every message on the list has many
helpful tips. One of these is that you should install the latest version of R
before asking for help on the list. v2.15.1 is quite old in Internet time.
BTW, if this your troubles are specific to running on MacOSX,
Your R is quite old -- newest version is at least 3.2.3 . As a general
rule, you should first upgrade to the current versions of both R and
packages **before posting**, as the posting guide requests I believe.
This is precisely to avoid problems like this.
If this fails to resolve your problems, r
Sarah Bortolamiol wrote :
> Dear John and R users,
>
> Thank you very much for your help
> In my consol, i typed:
> > install.packages("RcmdrPlugin.FactoMineR")
> And got the following message
> "Installing package(s) into '/Users/sarahcontequoi/Library/R/2.15/library'
> (as 'lib' is unspecified
Dear John and R users,
Thank you very much for your help
In my consol, i typed:
> install.packages("RcmdrPlugin.FactoMineR")
And got the following message
"Installing package(s) into '/Users/sarahcontequoi/Library/R/2.15/library'
(as 'lib' is unspecified)
Warning in install.packages :
package 'R
Dear Sekhar,
I'm sorry that you're experiencing these problems. Although you haven't said so
directly, I assume that you aren't able to use install.packages() to install
*any* CRAN packages, not just the Rcmdr package.
Downloading and unpacking the Rcmdr zip file doesn't install the package. Yo
> On Feb 10, 2016, at 5:23 AM, Duncan Murdoch wrote:
>
> On 10/02/2016 7:41 AM, Venky wrote:
>> Hi Team,
>>
>> Please anyone share the Shiny app code(Server and UI) for Multiple Linear
>> Regression. With dropdown menu
>>
>
> This is the wrong place to write for help with Shiny. I think RSt
Dear Sekhar,
> -Original Message-
> From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com]
> Sent: February 10, 2016 11:37 AM
> To: Fox, John
> Subject: RE: [R] Help required for Rcmdr
>
> Tks and sorry for inadvertently sending to u alone
And you apparently just did that again, so
Dear Sarah,
I don't entirely follow what you did, but my guess is that you installed the
Rcmdr and FactoMineR packages but not the RcmdrPlugin.FactoMineR package. If
that's the case, then install the RcmdrPlugin.FactoMineR, e.g., via
install.packages("RcmdrPlugin.FactoMineR") and try again.
Y
Dear R users,
I am a beginner in R so my question may be a bit stupid. I tried to search
in forums and did not find the answer I am looking for. I should precise
that I am using Rstudio on Mac (OsX 10.10.5).
I want to run a MCA analysis on my data (with Benzecri correction, with
active and supple
Hi
I am using the package extRemes to assess 100-year return period
runoffs with the GEV and GP distribution functions and the associated
95% confidence intervals.
I use the MLE method for that.
Now I would like to sample a few thousands values of return levels on
the profile likelihood betwee
Google! (e.g. on "R Language tutorials")
Some specific recommendations can be found here:
https://www.rstudio.com/resources/training/online-learning/#R
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka B
On 10 Feb 2016, at 10:04 , Wolfgang Waser wrote:
> Hi,
>
> sapply(l,"[",T,2)
>
> and
>
> sapply(l, function(e) e[, 2])
>
>
> work fine!
>
>
> Thanks a lot!
>
> Why is the second version "brute force and ignorance"? Is one of the
> versions to be preferred? If so, which and why (very brie
On 10/02/2016 7:41 AM, Venky wrote:
Hi Team,
Please anyone share the Shiny app code(Server and UI) for Multiple Linear
Regression. With dropdown menu
This is the wrong place to write for help with Shiny. I think RStudio
runs some forums for that, and StackOverflow also answers questions
a
Hi Team,
Please anyone share the Shiny app code(Server and UI) for Multiple Linear
Regression. With dropdown menu
Thanks and Regards
Venkatesan
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and mo
Hi,
I am trying to import Excel data set into Shiny app and i want to to create
dropdown menu for that.
Eg:1st column of the Excel data must come one tab, and 2nd column of Excel
data is an another,...and so on
And i have seperate caluculation file like(Wordcloud,Binomial Reg etc). I
want to merg
Why not use rep instead of gl:
levels <- c('BR', 'CNS', 'CO', 'LE', 'ME', 'LC', 'OV', 'PR', 'RE')
reps <- c(4, 6, 7, 6, 10, 9, 7, 2, 8)
rep(levels, reps)
David
On 10 February 2016 at 05:02, hehsham alpukhity via R-help <
r-help@r-project.org> wrote:
> I am trying to use the function gl (generat
Hi,
sapply(l,"[",T,2)
and
sapply(l, function(e) e[, 2])
work fine!
Thanks a lot!
Why is the second version "brute force and ignorance"? Is one of the
versions to be preferred? If so, which and why (very briefly, please)?
Results of the other options mentioned:
> sapply(l,"[[",2)
results
33 matches
Mail list logo