[R] Use of C functions inside the DLL object

2018-11-19 Thread Cleber N.Borges via R-help
hello everybody and good night ... I'm trying to learn how to use a DLL, via "dyn.load" and ".C" inside the R. I did some testing (below is a part of what I tried) and I could not figure out how to do this. If anyone can give a hint on how to do this manipulation, it would be a lot of help!

[R] plot one levelplot over another

2018-11-19 Thread Waichler, Scott R
Hi, I am using levelplot() to plot a primary response surface, z1. I wish to write a custom panel function that will let me plot another surface z2 = f(x,y) over z1. The second surface z2 is either NA or 1, and at locations where z2 = 1, I will use a color with low alpha to let the the z1

Re: [R] unique() duplicate() not what i am looking for

2018-11-19 Thread Fox, John
Dear Knut, Here's one way: > as.vector((table(Dup) > 1)[Dup]) [1] TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE Someone will probably think of something cleverer. I hope this helps, John -- John Fox, Professor Emeritus McMaster University Hamilton,

Re: [R] unique() duplicate() not what i am looking for

2018-11-19 Thread Rui Barradas
Hello, Try i <- !(duplicated(Dup) | duplicated(Dup, fromLast = TRUE)) Dup[i] or in one line, I post it like this to make it more clear. Hope this helps, Rui Barradas Às 14:41 de 19/11/2018, Knut Krueger escreveu: It should be simple but i do not find the right keywords: Dup = 

Re: [R] unique() duplicate() not what i am looking for

2018-11-19 Thread PIKAL Petr
Hi and maybe sloightly less complicated setdiff(Dup,Dup[duplicated(Dup)]) Cheers Petr > -Original Message- > From: R-help On Behalf Of Knut Krueger > Sent: Monday, November 19, 2018 3:42 PM > To: r-help@r-project.org >> r-help mailing list > Subject: [R] unique() duplicate() not what

Re: [R] unique() duplicate() not what i am looking for

2018-11-19 Thread PIKAL Petr
Hi Dup %in% Dup[duplicated(Dup)] Dup[!(Dup %in% Dup[duplicated(Dup)])] Cheers Petr > -Original Message- > From: R-help On Behalf Of Knut Krueger > Sent: Monday, November 19, 2018 3:42 PM > To: r-help@r-project.org >> r-help mailing list > Subject: [R] unique() duplicate() not what i

[R] unique() duplicate() not what i am looking for

2018-11-19 Thread Knut Krueger
It should be simple but i do not find the right keywords: Dup = c(1,2,3,4,1,2,3,5) I need 4,5 as result unique(Dup) gives me [1] 4 1 2 3 5 duplicated(Dup) gives me [1] FALSE FALSE FALSE FALSE TRUE TRUE TRUE FALSE I need [1] TRUE TRUE TRUE FALSE TRUE TRUE TRUE FALSE Kind regards

Re: [R] Request for aid in first R script

2018-11-19 Thread S Ellison
Pointers inline below: > > Since I'm a newbie on R, I was wondering if you could help me to achieve a > > small project that I think it's possible with this project (I cant seem to > > find a similar tool) > > > > I have a data file with about 2000 value lines, organized like this: > > > >

Re: [R] Request for aid in first R script

2018-11-19 Thread Thierry Onkelinx via R-help
Dear Kepler, Yes, R can do this all. But this is is to help you when you get stuck, not to do all the work for you... You are asking basic stuff, so any introduction book on R should contain sufficient information to get you going. So please do read on of those first. Best regards, ir. Thierry

Re: [R] subset English language using textcat package

2018-11-19 Thread Robert David Burbidge via R-help
Look at the help docs and examples for textcat and sapply: print(as.character(data$x[sapply(data$x, textcat)=="english"])) Although textcat defaults classify "This book is amazing" as dutch, so you may want to read the help for textcat and change the profile db ("p") or "method". On

[R] Request for aid in first R script

2018-11-19 Thread Rui Fernandes
Good morning My compliments to all. Since I'm a newbie on R, I was wondering if you could help me to achieve a small project that I think it's possible with this project (I cant seem to find a similar tool) I have a data file with about 2000 value lines, organized like this: x;y;z;j; ... I

[R] subset English language using textcat package

2018-11-19 Thread Elahe chalabi via R-help
Hi all, How is it possible to subset English text from a df containing German and English texts using textcat package? > library(textcat) > dput(data) structure(list(x = structure(c(2L, 6L, 5L, 3L, 1L, 4L), .Label = c("Dieses Buch ist erstaunlich", "I love this book", "ich