Re: [R] Extract student ID that match certain criteria

2017-03-12 Thread roslinazairimah zakaria
Another question, How do I extract ID based on the third and fourth letter: I have for example, AA14004, AB15035, CB14024, PA14009, PA14009 etc I would like to extract ID no. of AB14..., CB14..., PA14... On Mon, Mar 13, 2017 at 12:37 PM, roslinazairimah zakaria < roslina...@gmail.com> wrote: >

Re: [R] Extract student ID that match certain criteria

2017-03-12 Thread roslinazairimah zakaria
Hi Bert, Thank you so much for your help. However I don't really sure what is the use of y values. Can we do without it? x <- as.character(FKASA$STUDENT_ID) y <- c(1,786) My.Data <- data.frame (x,y) My.Data[grep("^AA14", My.Data$x), ] I got the following data: x y 1 AA14068 1

Re: [R] Extract student ID that match certain criteria

2017-03-12 Thread Bert Gunter
1. Your code is incorrect. All entries are character strings and must be quoted. 2. See ?grep and note in particular (in the "Value" section): "grep(value = TRUE) returns a character vector containing the selected elements of x (after coercion, preserving names but no other attributes)." 3. Wh

[R] Extract student ID that match certain criteria

2017-03-12 Thread roslinazairimah zakaria
Dear r-users, I have this list of student ID, dt <- c(AA14068, AA13194, AE11054, AA12251, AA13228, AA13286, AA14090, AA13256, AA13260, AA13291, AA14099, AA15071, AA13143, AA14012, AA14039, AA15018, AA13234, AA13149, AA13282, AA13218) and I would like to extract all student of ID AA14... only. I

Re: [R] nested structure for Ancova

2017-03-12 Thread li li
Thanks so much, Richard. That works. Hanna 2017-03-12 14:31 GMT-04:00 Richard M. Heiberger : > I think you need either > > mod4 <- lm( y ~ -1 + area / (month*group), data=two) > > mod5 <- lm( y ~ area / (month*group), data=two) > > With either of those, area:month and area:group and Residuals

Re: [R] display UTF8 characters in pdf

2017-03-12 Thread Thierry Onkelinx
Dear all, Thanks to Ista and Olivier. The solution of Ista works for some characters but not all. The solution of Olivier works, at least for the characters that I've tried. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team

Re: [R] [FORGED] display UTF8 characters in pdf

2017-03-12 Thread Paul Murrell
Hi This does not help with a solution, but ... The standard PDF device only does single-byte character sets (sbcs in the warning message). The conversion from a multi-byte character set (mbcs), which is what UTF8 is, will only work if the characters map to a single-byte character set (things

Re: [R] nested structure for Ancova

2017-03-12 Thread Richard M. Heiberger
I think you need either mod4 <- lm( y ~ -1 + area / (month*group), data=two) mod5 <- lm( y ~ area / (month*group), data=two) With either of those, area:month and area:group and Residuals add up. On Sun, Mar 12, 2017 at 10:39 li li wrote: > Hi All, > I have a dataset which contains 4 varia

Re: [R] nested structure for Ancova

2017-03-12 Thread Michael Dewey
Dear Hannah You say they are different (mod3 from mod1 and mod2) but in what way are the results different? On 12/03/2017 15:38, li li wrote: Hi All, I have a dataset which contains 4 variables: area, group, time, y, Area is a factor that has two levels A and B, group is a factor that is ne

[R] nested structure for Ancova

2017-03-12 Thread li li
Hi All, I have a dataset which contains 4 variables: area, group, time, y, Area is a factor that has two levels A and B, group is a factor that is nested within area. There are four groups within each area. y is the response variable, and time refers to different days. Below is the how data lo

Re: [R] Override/Insert (Change) a value (default value) inside a function

2017-03-12 Thread Rui Barradas
Hello, Just to add to what others have said, I believe you haven't understood the dots argument. Where you to change the function in the package and the correct form would be myplot <- function(x,y, ...) { plot(x,y,...) } Hope this helps, Rui Barradas Em 11-03-2017 22:11, Mohammad Tanvir A