Displaying 20 results from an estimated 300 matches similar to: "help with calculating the differences between dates"
2007 Aug 02
4
problem with reading data files with different numbers of lines to skips
Dear List,
I have 30 data files with different numbers of lines (31 and 33) that I want to skip before reading the files. If I use the skip option I can only choose either to skip 31 or 33 lines. The data files with 31 lines have no blank rows between the lines and the header row. How can I read the files without manually checking which files have 31 respectively 33 lines ? The only text
2008 Jan 28
1
help with checking out-of-range values in each column in data frame
Dear list,
I have following data, where I want to check if any value in each
column is out of range. For example, column "f1" can only take values
1-5, so if any values less than 1 or > 5 will be
defined as missing value (i.e. NA), column "f4" can only take values
of 1-3 and any values that are outside this interval will be
considered as missing values. The below
2009 Mar 05
1
is there any option like cex.axis in ggplot2?
Dear list,
I made boxplots using ggplot and want to control for x- and yaxis. Using "plot" I can do it by setting cex.axis equally to any size but can't figure out how to do it with ggplot.
ggplot(dat, aes(x = factor(time), y = volume)) + opts(axis.title.x=theme_text(size=8),axis.title.y=theme_text(size=8)) +
geom_boxplot() + geom_jitter(aes(colour = id))+labs(x =
2008 Feb 07
1
Calculate the difference between dates
Dear list,
I have two data columns (part of big data frame) containing dates presenting the dates when
two measurements (M1 and M2) were taken. The data consists of 73 individuals divided
in different groups. Each group was examined at different time points (see M1 date),but
the measurements (M1 and M2) within each group should be taken in the same day but due
to some practical issues,
2008 Apr 01
1
set the lower bound of normal distribution to 0 ?
Tom Cohen <tom.cohen78@yahoo.se> skrev: Thanks Prof Brian for your suggestion.
I should know that for right-skewed data,
one should generate the samples from a lognormal.
My problem is that x and y are two instruments that were thought to
be measured the same thing but somehow show a wide confidence interval
of the difference between the two intruments.This may be true that
these
2008 Feb 12
3
help with bwplot
Dear list,
I have following data set, which I want to plot the "Scale" variable on the
x-axis and "Mean"´on the y-axis for each Ageclass and for each sex. The Mean
value of each Ageclass for each sex would be connected by a line. Totally,
there should be 6 lines, from which three present the Mean values of each
Ageclass for respective sex. Are there any easy ways to do
2008 Oct 23
0
error when using logistic.display within a loop
Dear list,
I tried to apply the logistic regression to different response variables from a dataframe and would like to store the results using the function logistic.display from the "epicalc" package in a list, but got an error message "Error in eval(expr, envir, enclos) : y values must be 0 <= y <= 1". All the response variables have value of 0 or 1. It worked
2007 Sep 30
1
Append the sum of each row and column to a table matrix
Dear list,
I have following table
ee<-table(ID,Day)
ee
Day
ID 2 3 4 5 6 7 9 10 14 16
35 5 0 0 3 1 0 0 5 0 0
36 0 0 0 0 0 0 0 1 0 0
43 13 15 15 0 0 13 13 15 13 15
46 0 1 0 0 0 0 0 0 0 0
58 0 0 0 0 0 0 4 4 0 0
and want to calculate the sum for each row and column and then append the sums to the table matrix.
2018 May 01
0
how can I convert a long to wide matrix?
Hi Marna,
This is a condition that the function cannot handle. It would be
possible to reformat the result based on the time intervals, but the
stretch_df function doesn't try to interpret the values, just
stretches them out to a wide format.
Jim
On Wed, May 2, 2018 at 9:16 AM, Marna Wagley <marna.wagley at gmail.com> wrote:
> Hi Jim,
> The data set is correct. I took two
2009 Dec 08
0
Holiday Gift Perl Script for US Holiday Dummy Regressors
##### BEGIN CODE ######
#!/usr/bin/perl
######
#
# --start, -s = The date you would like to start generating regressors
#--end, -e = When to stop generating holiday regressros
# --scope, -c = D, W for Daily or Weekly respectively (e.g. Does this week
have a particular holiday)
# --file, -f = Ummm where to write the output silly!
#
# **NOTE** The EOM holiday is "End of Month" for
2009 Dec 08
0
Opps Correct Version of Holiday Regressor Perl Script
Here is the correct version. The old version is the redirect only version of
the script.
### BEGIN SCRIPT ####
#!/usr/bin/perl
######
# --start, -s = The date you would like to start generating regressors
#--end, -e = When to stop generating holiday regressros
# --scope, -c = D, W for Daily or Weekly respectively (e.g. Does this week
have a particular holiday)
# --file, -f = Ummm where to write
2018 May 01
2
how can I convert a long to wide matrix?
Hi Jim,
The data set is correct. I took two readings from the "SITE A" within a
short time interval, therefore I want to take the first value if there are
repeated within a same group of "timeGroup".
Therefore I wanted following
FinalData1
B1 B2
id_X "A" "B"
id_Y "A" "B"
thanks,
On Tue, May 1, 2018 at 4:05 PM, Jim
2018 May 01
2
how can I convert a long to wide matrix?
Hi Jim,
Thank you very much for your suggestions. I used it but it gave me three
sites. But actually I do have only two sites "Id_X" and "Id_y" . In fact
"A" is repeated two times for "Id_X". If it is repeated, I would like to
take the first one among many repeated values.
dat<-structure(list(ID = structure(c(1L, 1L, 1L, 2L, 2L), .Label =
2018 May 01
0
how can I convert a long to wide matrix?
Hi Marna,
Try this:
library(prettyR)
stretch_df(dat,idvar="ID",to.stretch=c("EventDate","SITE"))
Jim
On Wed, May 2, 2018 at 8:24 AM, Marna Wagley <marna.wagley at gmail.com> wrote:
> Hi R user,
> I was trying to convert a long matrix to wide? I have an example and would
> like to get a table (FinalData1):
>
>
> FinalData1
> B1
2018 May 01
0
how can I convert a long to wide matrix?
Hi Marna,
I think this is due to having three rows for id_X and only two for
id_Y. The function creates a data frame with enough columns to hold
the greatest number of values for each ID variable. Notice that the
SITE_n columns contain three values for id_X (A, A, B) and two for
id_Y (A, B, NA) as there was no third occasion of measurement for the
latter. Even though there are only two _values_
2018 May 01
2
how can I convert a long to wide matrix?
Hi R user,
I was trying to convert a long matrix to wide? I have an example and would
like to get a table (FinalData1):
FinalData1
B1 B2
id_X "A" "B"
id_Y "A" "B"
but I got the following table using the following code.
FinalData1
B1 B2
id_X "A" "A"
id_Y "A" "B"
the code and the
2011 Jan 03
8
Heroku, needs constant AppController updates?
Dear All,
Fairly new to rails and Heroku, so could be doing something wacky - do
let me know if you think my code practice is off, even if unrelated to
this error, I''d like to learn!
I''m using Rails 3.0.0, ruby 1.8.7, and ''sqlite3-ruby'', ''1.2.5'', :require
=> ''sqlite3''.
I''ve got an application that goes off and
2012 Apr 04
0
crosstabs and histograms with flexible binning of dates
Hi,
First, thank you to Duncan Mackay for getting me started processing dates
with R. Unfortunately, I need to do a little more than I initially expected.
I have 5K lines of data that look like this:
ID AREA DATE
0001 Center 2010-10-15
0002 Center 2010-01-02
0003 NorthWest 2010-02-05
0004 SouthWest 2010-05-11
I would like to create a script to create crosstabs like
2009 Feb 20
3
mean over previous cells
Dear RUsers,
I guess this is an easy question for someone a little familiar with
programming...(which I am not)...
I've got 2 colummns, one shows just dates(SST_date, Class 'Date' num), the
other one shows the SeaSurfaceTemperature (SST, num) at that certain date.
SST_date SST
2008-01-01 22.2
2008-01-02 21.8
2008-01-03 22.8
2008-01-04 22.9
2008-01-05 23.1
2008-01-06 23.2
...
2008 Dec 06
1
find with add of an atttributes
I have wrote this:
EventDate.find(:all,
:include => [:container,{:event =>
[:photo,:event_type_names]},{:place=>:location}],
:joins =>" RIGHT JOIN (SELECT
event_dates.id,date_add(event_dates.date, INTERVAL i DAY ) AS date
FROM (select 0 as i union all select 0 union all select 1
union all select 2) as integers CROSS JOIN event_dates