You don't actually need R1 as R2 via the LED will pull the pin high during the input mode, and all it will do is add extra unnescessary load to the I/O pin during output mode..