_
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-conta
://www.R-project.org/
>>>
>> posting-guide.html
>>
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>> --
>> Peter Dalgaard, Professor,
>> Center for Statistics, Copenhagen Business School
>> Solbje
lot(data = md, mapping = aes(x = a)) +
geom_bar(na.rm = T)
But I still have NAs in the picture. Why?
What am I missing?
Thank you!
--
Dimitri Liakhovitski
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE
To clarify: my question is not about "who could I exclude NAs from being
counted" - I know how to do that.
My question is: Why na.rm = T is not working for geom_bar in this case?
On Thu, Jul 27, 2017 at 8:24 AM, Dimitri Liakhovitski <
dimitri.liakhovit...@gmail.com> wrote:
&
it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Thu, Jul 27, 2017 at 7:49 AM, Dimitri Liakhovitski
> wrote:
> > To clarify: my question is not about "who could I exclude NAs from being
> > counted" - I know how
Jeff Newmiller
wrote:
> I suspect this is by design. Questions about "why" should probably cc the
> contributed package maintainer(s).
> --
> Sent from my phone. Please excuse my brevity.
>
> On July 27, 2017 7:49:47 AM PDT, Dimitri Liakhovitski <
> dimitri.liakhovit
y brevity.
>
> On July 27, 2017 8:18:03 AM PDT, Dimitri Liakhovitski <
> dimitri.liakhovit...@gmail.com> wrote:
> >Thank you, Bert!
> >
> >I do NOT have an object named "T" in scope (I checked - and besides, it
> >would never occur to me to use th
Important to notice: this seems to be an issue only with an unordered
factor on the X axis. When the variable is numeric or an ordered factor,
then it works as described in Help.
On Thu, Jul 27, 2017 at 11:58 AM, Dimitri Liakhovitski <
dimitri.liakhovit...@gmail.com> wrote:
> Š¢hank
Hello!
I have a string x:
x <- c("x - 84", "y - 293.04", "z = 12.5")
I want to remove all the non-numeric stuff from it. The following works:
gsub("[^0-9]", "", x)
However, it strips my numbers of "."
Help - how could I do the same
Thank you very much, gentlemen!
On Tue, Jul 26, 2016 at 5:48 PM, peter dalgaard wrote:
>
>> On 26 Jul 2016, at 23:28 , Dimitri Liakhovitski
>> wrote:
>>
>> Hello!
>>
>> I have a string x:
>> x <- c("x - 84", "y - 293.04",
ppiness: Part 2." ==
"What a nice day today: Story of happiness (Part 2)"
--
Thank you!
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
I think I found a partial answer:
str_replace_all(x, "[[:punct:]]", " ")
On Mon, Apr 20, 2015 at 9:59 AM, Dimitri Liakhovitski
wrote:
> Hello!
>
> Please point me in the right direction.
> I need to match 2 strings, but focusing ONLY on characters, ignor
f happiness: Part 2."
>> b = "What a nice day today: Story of happiness (Part 2)"
>> sa = gsub("[^A-Za-z0-9]", "", a)
>> sb = gsub("[^A-Za-z0-9]", "", b)
>> a==b
>> # [1] FALSE
>> sa==sb
>> # [1] TR
= as.character(x$b)
x
str(x)
I need to produce this data frame:
1 a
1 b
1 c
2 d
2 e
3 f
Is it possible without looping?
Thank you!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch
")))
>
> Duncan
>
> Duncan Mackay
> Department of Agronomy and Soil Science
> University of New England
> Armidale NSW 2351
> Email: home: mac...@northnet.com.au
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Di
) - so that I can't specify those counts.a,
counts.b, etc. manually - dozens of times.
Does dplyr allow to run the count of 5s on all 'myvars' columns at once?
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCR
300 Desmond Drive, Lacey, WA 98503-1274
>
>
> On Tue, 16 Jun 2015, Dimitri Liakhovitski wrote:
>
>> Hello!
>>
>> I have a data frame:
>>
>> md <- data.frame(a = c(3,5,4,5,3,5), b = c(5,5,5,4,4,1), c =
>> c(1,3,4,3,5,5),
>> device =
t;
> Cheers,
> Bert
>
> Bert Gunter
>
> "Data is not information. Information is not knowledge. And knowledge is
> certainly not wisdom."
>-- Clifford Stoll
>
> On Tue, Jun 16, 2015 at 10:24 AM, Dimitri Liakhovitski
> wrote:
>>
>> Hello!
>>
NA
md[4,1] <- NA
md
vapply(md[myvars], function(x) sum(x==5,na.rm=TRUE),1L)
But the result should be by device.
On Tue, Jun 16, 2015 at 1:56 PM, Dimitri Liakhovitski
wrote:
> Thank you, Bert.
> I'll be honest - I am just learning dplyr and was wondering if one
> could do it in dplyr.
&
.edu
> Department of Ecology VOICE: (360) 407-6815
> PO Box 47600FAX:(360) 407-7534
> Olympia, WA 98504-7600
>
> USPS: PO Box 47600, Olympia, WA 98504-7600
> Parcels:300 Desmond Drive, Lacey, WA 98503-1274
&g
Thank you guys - it's a great learning: 'summarise_each' and 'funs'
On Tue, Jun 16, 2015 at 3:47 PM, Hadley Wickham wrote:
> On Tue, Jun 16, 2015 at 12:24 PM, Dimitri Liakhovitski
> wrote:
>> Hello!
>>
>> I have a data frame:
>>
>> m
o be ignored (na.rm =
TRUE) - I tried, but the function doesn't want to accept this
argument.
Both these lines result in error:
md %>% group_by(device1, device2) %>% summarise_each(funs(mean),
na.rm = TRUE)
md %>% group_by(device1, device2) %>% summarise_each(funs(mean,
na.rm
(dplyr)
> md %>% group_by(device1, device2) %>% summarise_each(funs(mean))
>
> However, I am getting some NAs. I want the NAs to be ignored (na.rm =
> TRUE) - I tried, but the function doesn't want to accept this
> argument.
> Both these lines result in error:
>
>
I found the answer:
md %>% group_by(device1, device2) %>% summarise_each(funs(mean(.,
na.rm = TRUE)))
On Thu, Jun 25, 2015 at 4:35 PM, Dimitri Liakhovitski
wrote:
> Just want to clarify - I know how to do it using base R. I just want
> to figure out how to do it in dplyr. This i wh
Is there an R package that allows one to calculate skewness and
curtosis - but weighted with individual level weights (one weight per
observation)?
Thank you!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more
:
>
> On Jul 16, 2015, at 8:10 AM, Dimitri Liakhovitski wrote:
>
>> Is there an R package that allows one to calculate skewness and
>> curtosis - but weighted with individual level weights (one weight per
>> observation)?
>>
>
> Integer weights?
>
&
knowledge. And knowledge
> is certainly not wisdom."
>-- Clifford Stoll
>
>
> On Thu, Jul 16, 2015 at 8:37 AM, Dimitri Liakhovitski
> wrote:
>> Unfortunately not - more like 0.7654, 1.2345.
>> I understand that I could multiply each number by 100, round it t
a labels.
When I run lapply(spss1, attr, "label") I see under those 2 variables
"NULL" - which is true and valid.
However, would it be possible to have instead of NULL an NA? This way
the length of varnames and mylables would the same and one could put
them side by side (e.g., in
s1, attr_default, "label", NA_character_)
>
> (code untested, but you get the idea)
>
> Hadley
>
> On Mon, Jul 20, 2015 at 8:56 AM, Dimitri Liakhovitski
> wrote:
>> Hadley,
>>
>> you've added function labelled to haven, which is great. However,
elegant way?
Thank you very much!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.htm
[3,]0100
> [4,]1110
>
>
>
> Cheers,
> Bert
>
> Bert Gunter
>
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
>-- Clifford Stoll
>
>
> On Mon, Jul 27, 2015 at 12:38
With NAs it'd be:
rk <- c(2,NA,4,3,1, NA)
outer(rk, rk, "<") + 0
Wow, I still can't believe it - just one line!
On Mon, Jul 27, 2015 at 5:31 PM, Dimitri Liakhovitski
wrote:
> Wow!
>
> On Mon, Jul 27, 2015 at 5:28 PM, Bert Gunter wrote:
>> ## I leav
t;Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
> -- Clifford Stoll
>
>
> On Mon, Jul 27, 2015 at 2:32 PM, Dimitri Liakhovitski
> wrote:
>> With NAs it'd be:
>>
>> rk <- c(2,NA,4,3,1, NA)
>>
unding box to center/zoom specification. (experimental)
Does it mean that there is no way for me to create a map with these
exact corners?
Thank you!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https:/
ith NAs?
x[x$c<6,] # Leaves rows with c=NA, but makes the whole row an NA. Why???
x[(x$c<6) | is.na(x$c),] # output I need - I have to be super-explicit
Thank you very much!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UN
, but I'll replace all the values in this row with NAs?
On Fri, Feb 27, 2015 at 9:13 AM, Duncan Murdoch
wrote:
> On 27/02/2015 9:04 AM, Dimitri Liakhovitski wrote:
>> I know how to get the output I need, but I would benefit from an
>> explanation why R behaves the way it doe
Thank you very much, Duncan.
All this being said:
What would you say is the most elegant and most safe way to solve such
a seemingly simple task?
Thank you!
On Fri, Feb 27, 2015 at 10:02 AM, Duncan Murdoch
wrote:
> On 27/02/2015 9:49 AM, Dimitri Liakhovitski wrote:
>> So, Dun
frame(a=1:10,b=2:11,c=c(1,NA,3,NA,5,NA,7,NA,NA,10))
> > x[is.true(x$c >= 6), ]
> a b c
> 7 7 8 7
> 10 10 11 10
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Fri, Feb 27, 2015 at 7:27 AM, Dimitri Liakhovitski
> wrote:
>&g
in 'wait':
map('county', fill = TRUE, col = allcolors[mydata.final$wait],
resolution = 0, lty = 0, bg = "transparent")
map('state', lwd=1, add=TRUE)
My goal is: instead of splitting 'Mean.Wait' into 5 ordered categories
ol,
> resolution=0, lty=0, bg="transparent")
> map('state', lwd=1, add=TRUE)
>
> Jean
>
>
> On Thu, Apr 2, 2015 at 12:03 PM, Dimitri Liakhovitski
> wrote:
>>
>> I have a data frame 'mydata.final' (see below) that contains U
nal$Mean.Wait,
na.rm=T)), maxColorValue=255))
map('county', fill=TRUE, col=newcol,
resolution=0, lty=0, bg="transparent")
map('state', lwd=1, add=TRUE)
One understanding question: what exactly does this rgb line do and why
do we have to say "maxColorValue=255
es=c("yellow","red"),na.color="white")
>
> Jim
>
>
> On Fri, Apr 3, 2015 at 8:08 AM, Dimitri Liakhovitski
> wrote:
>>
>> Jean, I think I fixed it:
>>
>> newpal <- colorRamp(c("yellow", "red"))
>> missin
Is it possible to read a LIST file into R? Any package?
I've done some googling, but there are just too many hits for a regular 'list'.
Appreciate any pointers!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUB
IMDB. I guess I'll just have to open it as any text file.
On Tue, Apr 14, 2015 at 4:48 PM, Sarah Goslee wrote:
> What produced this file?
>
> On Tue, Apr 14, 2015 at 4:40 PM, Dimitri Liakhovitski
> wrote:
>> Is it possible to read a LIST file into R? Any package?
>&g
Dear Rers,
I am trying to run a for-loop in R.
During each iteration I read in an mp3 file and do some basic processing.
If I do what I need to do for each file one by one - it works fine.
But once I start running a loop, it soon runs out of memory and says: can't
allocate a vector of size...
In e
> Sent from my phone. Please excuse my brevity.
>
> On October 20, 2014 8:30:21 AM PDT, Dimitri Liakhovitski <
> dimitri.liakhovit...@gmail.com> wrote:
> >Dear Rers,
> >
> >I am trying to run a for-loop in R.
> >During each
on this mailing
>>>list,
>>>> self-contained examples are needed. And in order to not corrupt the
>>>example
>>>> you will need to post in plain text.
>>>>
>>>---
&
I will try with .wav files and report back.
So far, I am not sure I understood what could be done (if anything) to fix it...
On Tue, Oct 21, 2014 at 2:26 AM, Prof Brian Ripley
wrote:
> On 20/10/2014 17:53, John McKown wrote:
>>
>> On Mon, Oct 20, 2014 at 10:30 AM, Dimit
NULL,
>> NULL, NULL, NULL);
>
>
>
> Thanks, Bill!
> I haven't found the time to look at it.
> Now in the master sources, bugfix release will follow shortly,
> Uwe
>
>
>
>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
&
name="silence0.5sec 8000.wav",f=800)
But it doesn't work - it saves the file but when I read it in,
Samplingrate is still 44100
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PL
Thank you so much, Uwe!
seavewav is from another package :)
On Wed, Oct 22, 2014 at 4:03 PM, Uwe Ligges
wrote:
>
>
> On 22.10.2014 21:57, Dimitri Liakhovitski wrote:
>>
>> I've read in a wav file using 'tuneR':
>>
>> silence<-readWave("sile
Thank you so much, Uwe!
seavewav is from another package :)
On Wed, Oct 22, 2014 at 4:03 PM, Uwe Ligges
wrote:
>
>
> On 22.10.2014 21:57, Dimitri Liakhovitski wrote:
>>
>> I've read in a wav file using 'tuneR':
>>
>> silence<-readWave("sile
Dear R-ers,
apologies for not providing the full code. I just need a point in the
right direction.
I have a data frame ('temp') with 1,200 rows and 2 variables.
I am using ggplot2 to create a scatter plot:
This is my code and it works fine, it creates a scatter plot:
library(ggplot2)
sp10<-ggplo
Never mind, I found the problem.
In my profile s was assigned to summary.
This is why it did not work.
On Thu, Nov 20, 2014 at 5:14 PM, Dimitri Liakhovitski
wrote:
> Dear R-ers,
>
> apologies for not providing the full code. I just need a point in the
> right direction.
> I ha
mylist[[i]]<-df[c("a","b",myname)]
names(mylist[[i]])<-c("a","b","c")
}
out<-do.call(rbind,mylist)
out
Thank you!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list
https://stat.ethz.c
.c2 2 b c2 3 2
> 3.c2 3 c c2 4 3
> 4.c2 4 d c2 5 4
> 5.c2 5 e c2 6 5
> 1.c3 1 a c3 3 1
> 2.c3 2 b c3 4 2
> 3.c3 3 c c3 5 3
> 4.c3 4 d c3 6 4
> 5.c3 5 e c3 7 5
> 1.c4 1 a c4 4 1
> 2.c4 2 b c4 5 2
> 3.c4 3 c c4 6 3
>
Hello,
I know how to read in mp3 files, e.g., using tuneR.
But is it possible to read in a .wav file - as below and then compress
it to mp3 format?
library(tuneR)
mywav <- readWave("myfile.wav")
Thanks a lot for any hints!
--
Dimitri
[grep("1$", x)]
# Which strings end with "_1"? - WORKS
x[grep("\\_1$", x)]
# Which strings start with "q10" AND contain a "1"? - WORKS
x[grep("^q10.+1", x)]
# Which strings start with "q10" AND end with a "_1"
/2015 5:11 PM, Dimitri Liakhovitski wrote:
>> (x <- c("q10_1", "q10_2", "q10_11", "q12_1", "q12_2", "q13_1", "q13_11"))
>>
>> # Which strings start with "q10" or "q12? - WORKS
>> x[grep
For the last one, looks like this one works:
x[grep("^(q10|q12).*\\_1$", x)]
On Thu, Sep 17, 2015 at 5:46 PM, Dimitri Liakhovitski
wrote:
> Duncan,
> Of course my verbal descriptions and my code don't match my regexp -
> otherwise I wouldn't be asking the question
ttp://harvest.nps.edu
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Berend
> Hasselman
> Sent: Friday, September 18, 2015 1:30 AM
> To: Dimitri Liakhovitski
> Cc: r-help
> Subject: Re: [R] Hep with regex! - combination of ^,
ter(complete.cases(.))
But this command doesn't work:
filter(mydata, complete.cases(.))
Error: object '.' not found
Why doesn't it work?
Thank you!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and
SE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://s
x27;t figure out how to force xtabs to include NAs.
# All my attempts below fail to include NAs:
xtabs(~ a + b, x, na.action(na.pass))
xtabs(~ a + b, x, na.action = "na.pass")
xtabs(~ a + b, x, na.action(na.pass(x)))
xtabs(~ a + b, x, exclude = NULL)
Th
#x27;s output for a call to table.
>
> xtabs(formula = ~a + b, data = x, na.action = na.pass, exclude = NULL)
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
>
> On Wed, Sep 30, 2015 at 7:56 AM, Dimitri Liakhovitski
> wrote:
>> Please help:
>>
>> #
ar1/var2
With df's of weighted n1-1 for group 1 and weighted n2-1 for group 2?
Would it be kosher from statistical perspective?
Thanks a lot!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://s
I didn't just update them.
What could be the reason? I tried to totally delete the folders of
those packages, install them from scratch (successfully), still - they
keep appearing in Update Pacakges widnow.
Any advice?
Thank you!
--
Dimitri Liakhovitski
___
v 5, 2015 at 2:00 PM, Dimitri Liakhovitski
wrote:
> I am using a windows laptop, R 3.2.2
>
> I am using R-gui.
>
> When I go to Packages -> Update packages and then select a Cran mirror
> (in the US) - it tells me to update the following packages:
>
> GLMMGibbs
> RDCO
Thank you, Duncan.
Indeed those packages were sitting in a temp directory.
I had to install them manually from a 'zip file.
On Thu, Nov 5, 2015 at 2:40 PM, Duncan Murdoch wrote:
> On 05/11/2015 1:00 PM, Dimitri Liakhovitski wrote:
>>
>> I am using a windows laptop, R 3.2.2
&g
VERY/SOMEWHAT FAMILIAR" "NOT AT ALL FAMILIAR"
Question: How could I avoid the extraction of the Value Labels for the
columns that have no long labels?
Thank you very much!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list --
ny suggestions?
Thanks!
On Thu, Nov 12, 2015 at 11:56 AM, Dimitri Liakhovitski
wrote:
> Hello!
>
> I don't have an example file, but I think my question should be clear
> without it.
> I have an SPSS file. I read it in using 'haven':
>
> library(haven)
>
057?
Or should there also be an intercept present in this formula?
I did not specify any intercepts anywhere in my model?
If there should be an intercept, then where can I find it in the object sem1?
Thanks a lot!
--
Dimitri Liakhovitski
__
R-help@r
1 2
And I actually need to be able to identify if label is empty.
Thank you for looking into it!
Dimitri
On Thu, Nov 12, 2015 at 5:55 PM, Dimitri Liakhovitski
wrote:
> Looks like a little bug in 'haven':
>
> When I actually look at the att
the development version of rio
> (https://github.com/leeper/rio) has an (non-exported) function for
> cleaning up meta data from haven imports. See
> https://github.com/leeper/rio/blob/master/R/utils.R#L86
>
> Best,
> Ista
>
> On Thu, Nov 12, 2015 at 8:37 PM, Dimitri Liakh
;Species"], FUN = var)
by(data = iris[myvars], INDICES = iris["Species"], FUN = max)
by(data = iris[myvars], INDICES = iris["Species"], FUN = min)
by(data = iris[myvars], INDICES = iris["Species"], FUN = sd)
by(data = iris[myvars],
by=iris[,"Species", drop=FALSE], FUN=mean)
>
> provide the answers I would expect. If you want clearer advice, you
> need to provide an actually reproducible example, and tell us more
> about what you expect to get.
>
> Sarah
>
>
> On Tue, Dec 8, 2015 at 5:30 PM, Dimi
t; aggregate() calls its FUN with each column of a data.frame as the argument.
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Tue, Dec 8, 2015 at 3:08 PM, Dimitri Liakhovitski
> wrote:
>>
>> Sorry, I omitted the first line:
>>
>> myvars <
] <- myinfo[myinfo$version == result[[i]]$version, ]
result[[i]]$myid <- id
result[[i]] <- result[[i]][c(5, 1:4)]
}
result <- do.call(rbind, result)
head(result) # This is the desired result
--
Dimitri Liakhovitski
__
R-help@r-pr
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>
> On Tue, Dec 22, 2015 at 12:27 PM, Dimitri Liakhovitski
> wrote:
>>
>> Hello!
>> I have a solution for my task that is based on a loop. However, it
erge
my.merge <- merge(myinfo, mydata, by="version")
names(my.merge)
result2 <- my.merge[,c("myid", "version", "a", "b", "c", "d")]
names(result2)
result2.order <- arrange(result2, myid, version, a, b, c, d)
dim(result2.or
Actually, the correct merge line should be:
my.merge <- merge(myinfo, mydata, by="version", all.x = T, all.y = F)
On Tue, Dec 22, 2015 at 3:50 PM, Dimitri Liakhovitski
wrote:
> You are right, guys, merge is working. Somehow I was under the
> erroneous impression that beca
Taking it back - no need for all.x = T, all.y = F
On Tue, Dec 22, 2015 at 3:56 PM, Dimitri Liakhovitski
wrote:
> Actually, the correct merge line should be:
> my.merge <- merge(myinfo, mydata, by="version", all.x = T, all.y = F)
>
> On Tue, Dec 22, 2015 at 3:50 PM, Dimi
# I have a matrix x:
k <- 20
N <- 5
set.seed(123)
x <- matrix(c(sample(1:k, N, replace = F),
sample(1:k, N, replace = F),
sample(1:k, N, replace = F),
sample(1:k, N, replace = F),
sample(1:k, N, replace = F),
sample(1:k, N, repl
and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Tue, Dec 22, 2015 at 3:03 PM, Marc Schwartz wrote:
>>
>>> On Dec 22, 2015, at 4:42 PM, Dimitri Liakhovitski
>>> wrote
mber of games and the number of sets per game.
# However, we can assume that the number of sets per game is always the same,
# and the number of players per set is always the same.
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNS
har", names(x))])
> newx <- x
> newx$char <- row(y)[y==1]
>
> # merge and define winner
> res <- merge(newx, info2)
> res$winner <- with(res, ifelse(char==val, 1, 0))
> res
>
>
> On Wed, Dec 23, 2015 at 3:35 PM, Dimitri Liakhovitski
> wrote:
>>
Hello!
# I have a data frame x:
x <- data.frame(a = 1:10, b = 2:11, c = 3:12, other = rnorm(10))
# First, I need to change every value 7 in columns a:c to 4
# Then, I need to decrease by 1 all values in columns a:c that are >7
What would be the fastest way of doing it?
Thank you!
--
D
a frame?
Thanks!
On Fri, Jan 22, 2016 at 11:34 AM, Dimitri Liakhovitski
wrote:
> Hello!
>
> # I have a data frame x:
> x <- data.frame(a = 1:10, b = 2:11, c = 3:12, other = rnorm(10))
>
> # First, I need to change every value 7 in columns a:c to 4
> # Then, I need t
Or I could repeat each element of y and multiply two matrices - that's better:
rep.row<-function(x,n){
matrix(rep(x,each=n),nrow=n)
}
y <- rep.row(y, nrow(x))
x * y
However, maybe there is a more elegant r-like way of doing it?
Thank yo
>>
>>> sweep(x, 2, y, "*")
>> [,1] [,2]
>> [1,]2 12
>> [2,]4 15
>> [3,]6 18
>>>
>>
>>
>> On Thu, Nov 3, 2016 at 5:05 PM, Dimitri Liakhovitski
>> wrote:
>>> Hello!
>>>
>>> I h
operation is performed column-wise:
>
> t(y * t(x))
>
> Hope this helps,
>
> Rui Barradas
>
>
> Em 03-11-2016 21:05, Dimitri Liakhovitski escreveu:
>>
>> Hello!
>>
>> I have a matrix x and a vector y:
>>
>> x <- matrix(1:6, ncol = 2)
non-NAs in each row:
x <- data.frame(a = c(1:5), b=11:15, c=c(111:114,NA))
x
I'd like it to return:
[1] 111 112 113 114 15
Thanks a lot!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
http
To clarify:
I know I could do:
apply(x, 1, max, na.rm = T)
But I was wondering if one can modify the pmax one...
On Wed, Nov 16, 2016 at 3:58 PM, Dimitri Liakhovitski
wrote:
> Hello!
>
> I need to calculate the maximum of each row of a data frame.
> This works:
>
> x <-
gt; do.call(pmax, c(x, na.rm=TRUE))
> [1] 111 112 113 114 15
>
> On Wed, Nov 16, 2016 at 3:58 PM, Dimitri Liakhovitski
> wrote:
>> Hello!
>>
>> I need to calculate the maximum of each row of a data frame.
>> This works:
>>
>> x <- data.frame(a =
Thank you, Peter!
On Wed, Nov 16, 2016 at 4:21 PM, peter dalgaard wrote:
>
>> On 16 Nov 2016, at 21:58 , Dimitri Liakhovitski
>> wrote:
>>
>> Hello!
>>
>> I need to calculate the maximum of each row of a data frame.
>> This works:
>>
>
t in the second case?
Thanks a lot!
--
Dimitri Liakhovitski
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
a
and discovered that
DoubleMetaphone can't process non-ASCII characters (like Umlauts in
German, accents in French).
What would you recommend I use instead?
Use 'phonetic' from stringdist?
Thank you!
--
Dimitri Liakhovitski
__
R-help@r-project.org
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&qu
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."
> -- Opus (aka Berkeley
sured
> that all "official" R packages have been "vetted" and are safe?
>
> Thanks a lot!
>
> --
> Dimitri Liakhovitski
>
>
>
> Dimitri,
>
> You are going to need to define "safe".
>
> Also, note that the notion of "official
1 - 100 of 633 matches
Mail list logo