if statement - First and Last in SAS and R -


I am working on converting a SAS code to R, but I have to do IF first to replicate Used to be. & Amp; Final In the command. SAS command is -

  Data A; Set B; From the comp ID, date; If first date; Run;   

My understanding is that only the first date for CompID, ID and date combination is selected and the data is output A. Am i right

I know about the duplicate command in the RR, but if I use the following code -

  A & lt; - B [! Duplicated (B $ date),]   

I get less overview than my SAS output. Am I missing something here?

Thank you in advance.

R can also be created in a duplicated data frame function): < / P>

  a & lt; - B [! To duplicate (duplicate) (BC, 'compedit', 'id', 'date')]],]   

. For previous action, look for the help page for duplicates and see me Looks like you'll find a type of from , but I always need to check its spelling.

Build: "I get fewer comments than this. .. "I feel wrong, but I do not travel in all English speaking countries The Minister. At least in the US, I think that "little" or "a small number" will read a little easier.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -