Is it okay to take a day off as an undergraduate?
Your health is important to maintain. It does you little good to work harder than your mind and body can accommodate. 

Burn out is a serious issue. Some people work so hard for so long that they just, one day, decide it isn't fun anymore and quit, cold. 

Your mind will continue to work on problems without being conscious of it and without being forced to concentrate on those problems. People often wake up in the morning or after a nap with a solution to a tricky problem. 

So, yes, learn to take breaks, whether short or longer - preferably both. Work when you are relaxed if you can make that happen. 

You can also, perhaps learn to use some of the travel time to either just relax or to work on things that don't require access to a machine. This might make the "day off" less of an issue. But don't take this suggestion to mean "work always". For example, some people carry index cards on which they write definitions of things or something about a current problem. If they find a moment of boredom, say on a bus, then they can pull out a few cards and leaf through them, just reinforcing their learning. 

See Hipster PDA, for example.