Displaying 2 results from an estimated 2 matches for "havesamelength".
2010 Dec 20
2
Turning a Variable into String
...bles. This
works fine in the bit working out number of elements in each variable.
In the print(sprintf("OK with %s and %s\n", var1, var2)) line I would like
var1 and var2 to be magically substituted with a string containing the name
of var1 and name of var2.
Thanks in advance
Paolo
haveSameLength <- function(var1, var2) {
if (length(var1)==length(var2))
{
print(sprintf("OK with %s and %s\n", var1, var2))
} else {
print("Problems!!")
}
}
[[alternative HTML version deleted]]
2010 Dec 19
3
monthly median in a daily dataset
Hello,
I have a multi-year dataset (see below) with date, a data value and a flag
for the data value. I want to find the monthly median for each month in this
dataset and then plot it. If anyone has suggestions they would be greatly
apperciated. It should be noted that there are some dates with no values and
they should be removed.
Thanks
Emily
> print ( str(data$flow$daily) )