Using R to import specific records from a PDB file
If your file is in PDB format as the one shown here in .pdb format then you can simply extract your desired fields using sed which is a programming language used to parse and transform text. As for this structure i.e 6C4A in .pdb format HETNAM and HETSYN can be extracted using sed as follows:

sed  -n -e '/HETNAM/ p' -e '/HETSYN/ p'  6C4A.pdb

HETNAM     EJA S-[(1Z)-2-CARBOXY-N-HYDROXYETHANIMIDOYL]-L-CYSTEINE              
HETNAM     PYR PYRUVIC ACID                                                     
HETNAM      MG MAGNESIUM ION                                                    
HETNAM     3NP 3-NITROPROPANOIC ACID                                            
HETNAM     PEG DI(HYDROXYETHYL)ETHER                                            
HETNAM     EPE 4-(2-HYDROXYETHYL)-1-PIPERAZINE ETHANESULFONIC ACID              
HETSYN     EPE HEPES