ike to select the student id where the third and fourth value
>> represent the year they register data is eg. AA15..., AE14,... and I would
>> also to select their cgpa value.
>>
>> Thank you.
>>
>> On Mon, Mar 13, 2017 at 2:26 PM, roslinazairimah zakaria <
>&
15..., AE14,... and I would
also to select their cgpa value.
Thank you.
On Mon, Mar 13, 2017 at 2:26 PM, roslinazairimah zakaria <
roslina...@gmail.com> wrote:
Thank you so much for your help.
On Mon, Mar 13, 2017 at 1:52 PM, bioprogrammer
wrote:
Hi.
I would use the "substr" f
slinazairimah zakaria <
roslina...@gmail.com> wrote:
> Thank you so much for your help.
>
> On Mon, Mar 13, 2017 at 1:52 PM, bioprogrammer
> wrote:
>
>> Hi.
>>
>> I would use the "substr" function:
>>
>> https://stat.ethz.ch/R-manual/R-devel/library
Hi Roslinazairimah,
What you seem to want is fairly simple:
dt<-c("AA14068","AA13194","AE11054","AA12251","AA13228",
"AA13286","AA14090","AA13256","AA13260","AA13291",
"AA14099","AA15071","AA13143","AA14012","AA14039",
"AA15018","AA13234","AA13149","AA13282","AA13218")
dt[grep(pattern="AA14"
Hi Roslinazairimah,
As Bert suggested, you should get acquainted with regular expressions. It
can be confusing at times, but pays off in the long run.
In your case, the pattern of "^[A-Z]{2}14.*" might work.
Best,
Ulrik
On Mon, 13 Mar 2017 at 06:20 roslinazairimah zakaria
wrote:
> Another que
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:
>
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
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
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
9 matches
Mail list logo