R-Help (and package author)
I'm trying to understand within the context of R what the benefit of using an
iterator is. My only goal in using the foreach package is to improve
computational speed with some embarrassingly parallel tasks I have to compute.
I took the example found at the link belo
Dear Harold,
I get a different story
library(doParallel)
library(microbenchmark)
cl <- makeCluster(4)
registerDoParallel(cl)
x <- matrix(rnorm(100), ncol=1000)
itx <- iter(x, by='row')
microbenchmark(
iterator = foreach(i=itx, .combine=c) %dopar% mean(i),
base = foreach(i= 1:nrow(x), .com
I want to create two files train and test using dplyr (by random sampling
method). How to do the same same using lets say iris data.
Regards
Parth
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and mo
Hello!
I am processing some strings using package "PGRdup".
I using function 'DoubleMetaphone' to generate the double metaphone
codes of strings - to match words that sound alike (in case they were
written differently).
However, I got some French and German strings and discovered that
DoubleMetap
Usually we expect posters to do their homework by reading necessary R
documentation and relevant subject matter resources (e.g. on
clustering) and making a serious attempt to solve the problem by
offering their code to us along as part of a reproducible example of
how it failed. You have done none
Guys,
suddenly, I am being asked for a proof that R packages that are not
'"base" are safe. I've never been asked this question before.
Is there some documentation on CRAN that discusses how it's ensured
that all "official" R packages have been "vetted" and are safe?
Thanks a lot!
--
Dimitri L
In addition to 'sample', and if you insist on dplyr, you can use 'sample_n'.
Best,
Ulrik
On Thu, 8 Dec 2016 at 18:47 Bert Gunter wrote:
> Usually we expect posters to do their homework by reading necessary R
> documentation and relevant subject matter resources (e.g. on
> clustering) and making
1. What does "Safe" mean???
2. From the R banner on startup:
"R is free software and comes with ABSOLUTELY NO WARRANTY."
Don't think it could be clearer than that!
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
--
> On Dec 8, 2016, at 11:47 AM, Dimitri Liakhovitski
> wrote:
>
> Guys,
>
> suddenly, I am being asked for a proof that R packages that are not
> '"base" are safe. I've never been asked this question before.
>
> Is there some documentation on CRAN that discusses how it's ensured
> that all "of
I just thought maybe there is something - about the process of
submitting packages or anything like that - that shows that at least
some diligence is being done to ensure that a given package is not
just a piece of malware from ISIS or Russia.
But if you, Bert, say it's not the case, then I'll beli
Thank you, Marc.
That's helpful!
I think, in this case it's mostly:
That they are virus/malware free.
And that they don't send out some info that they are not supposed to.
Thank you!
Dimitri
On Thu, Dec 8, 2016 at 1:04 PM, Marc Schwartz wrote:
>
> On Dec 8, 2016, at 11:47 AM, Dimitri Liakhovit
On the plus side, all binary packages on CRAN are built from source code
automatically by the CRAN team, so it would be a bit audacious to include
"unsafe" code when the source code had to reviewable at any time.
There is nothing in R that would prevent a user from downloading a binary
package
Great to know thanks, Bert!
Do you happen to have a reference that shows that:
-U. Wien checks R packages on submission for malicious code
-R repository servers have filters in place.
Thanks again!
On Thu, Dec 8, 2016 at 1:13 PM, Bert Gunter wrote:
> Dimitri:
>
>
>
>
> On Thu, Dec 8, 2016 at 10
On Thu, Dec 8, 2016 at 10:16 AM, Dimitri Liakhovitski
wrote:
> Great to know thanks, Bert!
>
> Do you happen to have a reference that shows that:
> -U. Wien checks R packages on submission for malicious code
> -R repository servers have filters in place.
No. Ask them
-- Bert
>
> Thanks again!
>
Dimitri:
On Thu, Dec 8, 2016 at 10:05 AM, Dimitri Liakhovitski
wrote:
> I just thought maybe there is something - about the process of
> submitting packages or anything like that - that shows that at least
> some diligence is being done to ensure that a given package is not
> just a piece of m
Dimitri,
Even if you narrowly define "safe" as being virus/malware free and even if the
CRAN maintainers have extensive screening in place, the burden will still be on
the end users to test/scan the downloaded packages (whether in source or binary
form), according to some a priori defined stand
On 12/8/2016 12:08 PM, Dimitri Liakhovitski wrote:
Thank you, Marc.
That's helpful!
I think, in this case it's mostly:
That they are virus/malware free.
And that they don't send out some info that they are not supposed to.
Doing those things are absolutely against CRAN policies, but y
Thanks a lot, guys - it's very helpful!
On Thu, Dec 8, 2016 at 1:24 PM, Marc Schwartz wrote:
> Dimitri,
>
> Even if you narrowly define "safe" as being virus/malware free and even if
> the CRAN maintainers have extensive screening in place, the burden will still
> be on the end users to test/sc
On 12/8/2016 12:24 PM, Marc Schwartz wrote:
Dimitri,
Even if you narrowly define "safe" as being virus/malware free and even if the
CRAN maintainers have extensive screening in place, the burden will still be on the end
users to test/scan the downloaded packages (whether in source or binary
Inline below...
> On Dec 8, 2016, at 12:27 PM, Spencer Graves
> wrote:
>
>
>
> On 12/8/2016 12:24 PM, Marc Schwartz wrote:
>> Dimitri,
>>
>> Even if you narrowly define "safe" as being virus/malware free and even if
>> the CRAN maintainers have extensive screening in place, the burden will
Hi all,
I am trying to run a macro by R in a EMME script. The R macro that we wrote
is called IPFPUMS.R. The whole process has been working until someone
removed R. We tried to re-install R but getting the error message:
“‘R’ is not recognized as an internal or external command, operable progra
Since you didn't say, I'm going to assume this is Linux.
One option would be to put the full path to R in the call in the EMME
script. This might be, for example
/usr/local/bin/R --save < IPFPUMS.R
Without the asterisks before and after, unless they are a requirement of
EMME (which I've never he
This looks like it has nothing to do with R per se and therefore is
likely OT here. Please consult your local IT resources for help.
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in hi
Hi Grace,
It is almost certainly a directory problem. The new R installation may
be in a different directory from the old one. Does R run from the
Start menu or a desktop icon? If so, look at "Properties" to discover
where it is located and use the explicit path (e.g. C:\Users\Grace\R
-save < IPFPU
Hi
You could try ...
grid.export(..., strict=FALSE)
... and/or install the latest gridSVG version from R-Forge ...
https://r-forge.r-project.org/R/?group_id=1025
Paul
On 09/12/16 11:13, Fix Ace wrote:
Hi, Paul,
Thank you very much for your reply. I tried your sample code, but did
not get g
Hello!
I have a vector of strings 'x' that was based on a longer string
'mystring' (the actual length of x is unknown).
mystring <- "this is my vector"
x <- strsplit(mystr, " ")[[1]]
I am looking for an elegant way of creating an object (e.g., a list)
that contains the following strings:
"this"
You can use expand.grid() and mapply():
mystring <- "this is my vector"
mystring.spl <- strsplit(mystring, " ")[[1]]
makestrings <- function(x) {
len <- length(mystring.spl)
idx <- expand.grid(1:len, 1:len)
idx <- idx[idx$Var2 <= idx$Var1, c("Var2", "Var1")]
mapply(function(x,
Thanks a lot, David - this is great!
On Thu, Dec 8, 2016 at 6:51 PM, David L Carlson wrote:
> You can use expand.grid() and mapply():
>
> mystring <- "this is my vector"
> mystring.spl <- strsplit(mystring, " ")[[1]]
>
> makestrings <- function(x) {
> len <- length(mystring.spl)
> idx <
> ij <- combn(length(x)+1, 2)
> lapply(seq_len(ncol(ij)), function(k) x[ij[1,k]:(ij[2,k]-1)])
[[1]]
[1] "this"
[[2]]
[1] "this" "is"
...
[[9]]
[1] "my" "vector"
[[10]]
[1] "vector"
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Thu, Dec 8, 2016 at 3:02 PM, Dimitri Liakhovitski <
dimitri.l
This corrects an error in my earlier function definition:
makestrings <- function(vec) {
len <- length(mystring.spl)
idx <- expand.grid(1:len, 1:len)
idx <- idx[idx$Var2 <= idx$Var1, c("Var2", "Var1")]
mapply(function(x, y) paste(vec[x:y], collapse=" "),
x=idx[, 1],
Not my day. Another correction:
makestrings <- function(vec) {
len <- length(vec)
idx <- expand.grid(1:len, 1:len)
idx <- idx[idx$Var2 <= idx$Var1, c("Var2", "Var1")]
mapply(function(x, y) paste(vec[x:y], collapse=" "),
x=idx[, 1], y=idx[, 2])
}
David C
-Origin
Hi,
I try to save my history:
> if (interactive()) try(savehistory(file=paste0(dir,"/.Rhistory")) )
to get: Error in .External2(C_savehistory, file) : no history vailable
to save
My system:
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.
Hi, Paul,
Thank you very much for your reply. I tried your sample code, but did not get
gradient filling (still empty box). And many warnings:1: In checkAttrs(attrs,
eltName) :
Removing non-SVG attribute name(s): fill, fill-opacity
2: In checkAttrs(attrs, eltName) :
Removing non-SVG attribute
How to get two sets of non overlapping data?
Regards
Parth
On 8 December 2016 at 23:23, Ulrik Stervbo wrote:
> In addition to 'sample', and if you insist on dplyr, you can use
> 'sample_n'.
>
> Best,
> Ulrik
>
> On Thu, 8 Dec 2016 at 18:47 Bert Gunter wrote:
>
>> Usually we expect posters to do
df <- data.frame(x = 1:12, y = rnorm(12))
If you use sample:
RowIndex <- sample(1:nrow(df), 5)
TrainSet <- df[RowIndex, ]
TestSet <- df[-RowIndex, ]
Or with dplyr:
TrainSet <- sample_n(df, 5)
TestSet <- anti_join(TestSet, df)
HTH
Ulrik
On Fri, 9 Dec 2016, 06:56 Partha Sinha, wrote:
> How to
35 matches
Mail list logo