This entry is a quick tip about Bash shell. Many times I want to remove (rm), copy (cp), move (mv) or do other things (cat, head, etc.) to all files in a directory, except to a particular one or ones. If there are few files in a directory, it is not a big problem. But…
Groups for cross validation
This post is for people that are interested in cross-validation or need, for any reason, to create random groups to perform some analysis. Some years ago, I had to do cross-validation and received from Ignacio Aguilar a simple and efficient tip using awk. To create random groups in a data set you can use the…
Loops. General view. For do loops.
Another suggestion of my colleague in the office. He asked me about loops in R. But I decided to do a more general post, because loops are structures that you will find in every programming language. So it is interesting to understand how they work and then apply the concept to a specific language. Loops…
R – reading data. Part I: Excel files.
Since a couple of months I’ve been sharing the office with an intern (aka “el Brian” ) who is learning to program. He has many doubts and one of them was how to read data in R. I remember the first time I saw the R console, I thought, “How the f**k can I read…
R – rendering multiple reports
Some years ago I had to do a lot of reports for different breeders. They were reports based on the results of a research and it was the same report with data for each separated herd. Logically, I could have done it in Word, one by one, but they were around 50 herds. So I…