Displaying 20 results from an estimated 1000 matches similar to: "subtract values"
2010 Feb 10
2
sum sections of data of different lengths from within a data frame
Dear R Help:
I am trying to sum data from one column in a dataframe based on a value in another. I do not know how to do this easily in R.
For example:
Col A Col B
1 0
3 0
2 1
2 0
1 0
4 0
1 1
9 1
3 0
5 0
2 1
I would like to cumsum the values in Col A for all rows where Col B is 0, and a value of 1 in Col B will reset
2011 Jun 13
1
maintaining row connections during aggregate
Dear All,
I have several sets of data such as this:
year jday avg_m3s
1 1960 1 4.262307
2 1960 2 4.242308
3 1960 3 4.216923
4 1960 4 4.185385
5 1960 5 4.151538
6 1960 6 4.133846
...
There is a value for each day of multiple years. In this particular data set it goes up to 1974. I am am looking to obtain the minimum and maximum values for each year, but also know on which
2012 Feb 23
1
perform t.test by rows and columns in data frame
Dear R Help,
I have been struggling with this problem without making much headway. I am attempting to avoid using a loop, and would appreciate any suggestions you may have. I am not well versed in R and apologize in advance if I have missed something obvious.
I have a data set with multiple sites along a river where metal concentrations were measured. Three sites are located upstream of a mine
2017 Sep 13
2
compounding precipitation based on whether falls within a day
Using the small reproducible example below, I'm wondering how best to
complete the following task:
In the small reproducible example below, the 3D array prec has indexes that
correspond to time, x, y (i.e., prec[time, x, y]). In this case, the time
index is hours since some predefined start time. I'd like to add up all
the time indexes in 'prec' based on whether or not the
2008 Jan 25
2
form formatting
If I want to use fbml elements and rails tags, is there a way to do
within a fb:editor?
if I do:
<% facebook_form_for(:task, at task,:url => create_task_path) do |f| %>
Assign Task To: <%= fb_friend_selector %>
<%=f.text_field :ttype, :label=> "Title"%>
<%=text_field_tag :newrnumdays, ndays, :label => "# Days"%>
2017 Sep 13
0
compounding precipitation based on whether falls within a day
Thanks for the reprex. Wouldn't have bothered without it.
The following is I believe **almost** what you want. It seems a bit clumsy
to me, so others may provide you something neater. But anyway...
## Convert POSIXct vector to dates
## There are 22 different days, not 21
date <- as.Date(prec_idx)
## Sum results by date at each i,j of the last 2 array dimensions
z <-
2011 Jun 23
1
else problem
Dear R users,
I have run into a problem using if...else and I hope you can shed some light on it. I am using R version 2.2.0.1.
I have the following data frame:
> head(dat2f)
year tot_km3y
[1,] 1964 0.1876854
[2,] 1965 0.1835116
[3,] 1966 0.1915012
[4,] 1967 0.1869758
[5,] 1968 0.2249865
[6,] 1969 0.1916011
I need to pick out the median year, and since there are an even number of data,
2004 Sep 29
5
Warning: number of items to replace is not a multiple of replacement length
What does this warning mean precisely?
Is there any reason to care about it?
Can I Avoid it by another way of programming?
Thank you in advance.
2011 Mar 04
2
How to copy data from data.frame to matrix
Hello
I'm a new in R
I have a large data.frame "s" (this is actualy just a table in mysql) :
> names(s)
[1] "symbols", "day", "value"
I need to convert it to simple matrix. I have define this matrix like this:
> data.matrix <- matrix(nrow=nDays, ncol=nSymbols, dimnames=list(days,
symbols))
then i just copy values to the matrix using for()
2010 Mar 12
5
Vertical subtraction in dataframes
Hello all,
I have not been able to find an answer to this problem. I feel like it might
be so simple though that it might not get a response.
Suppose I have a dataframe like the one I have copied below (minus the
'calib' column). I wish to create a column like calib where I am subtracting
the 'Count' when 'stain' is 'none' from all other 'Count' data for
2003 Nov 06
2
Number of Days
Hi everyone,
I have been trying to compute numbers of days between two dates as follows:
> x <- c("1jan1960", "2jan1960", "31mar1960", "30jul1960")
> z <- format(x, "%d%b%Y")
> ex <- c("1jan1961", "15jan1960", "21mar1975", "10jul1981")
> ez <- format(ex, "%d%b%Y")
> ez-z
2005 Jun 22
17
[PATCH] fix broken ACM
The latest change to ACM makes it fail to compile. This patch fixes the problem.
Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
$ diffstat acm.patch
acm/acm_core.c | 61 ---------------------
include/acm/acm_hooks.h | 135 ++++++++++++++++++++++++++++++++++--------------
2 files changed, 96 insertions(+), 100 deletions(-)
_______________________________________________
2016 Apr 01
2
Centos7: Mount problem (Unit mnt-bk\x2dbenvet\x2d01.mount is bound to inactive unit dev-disk-by\x2dlabel-bk\x2dbenvet\x2d01.device. Stopping, too.
On a server Centos 7.2 ?I insert my 1Tb usb disk and run
sudo mount LABEL=bk-benvet-01 /mnt/bk-benvet-01
the command seem to work but nothing is mounted
Into log I see this issue:
> apr 01 13:49:06 s-virt.dom.loc kernel: XFS (sdb1): Mounting V4 Filesystem
> apr 01 13:49:06 s-virt.dom.loc kernel: XFS (sdb1): Ending clean mount
> apr 01 13:49:06 s-virt.dom.loc systemd[1]: Unit
2005 Dec 19
3
given a mid-month date, get the month-end date
I have a vector of dates.
I wish to find the month end date for each.
Any suggestions?
e.g.
For 12/15/05, I want 12/31/05,
For 10/15/1995, I want 10/31/1995, etc
__________________________________________________
[[alternative HTML version deleted]]
2006 Jun 17
4
free sun boxes
I have 4 sparc based sun boxes I am about to pay money so I can
get rid of them. They are running older versions of Solaris.
You should be able to load Solaris 10 and play around with *
on them.
Time to clean the office:
3 Ultra 5
1 Sparcstation 5
I also have a box full of Sun keyboards and mice.
Contact me offline if you want them.
I've had many good years of development on them and it
2006 Jun 19
4
Backups 300VA (BK-300C) Drivers
Hi,
What driver should i use with APC BK-300C ?
Michale Plourde
Digicom Technologies
2004 Aug 06
2
where is the icecast 2 source?
Jack Moffitt wrote:
>
> > 3. I searched the mailing list archive, and got a pointer to
> > http://i.cantcode.com/~jack/ where there are some old snapshots
>
> Funny how you found that, but not this:
>
> http://i.cantcode.com/~jack/icecast.html
was looking for .tar.gz, as the e-mail mentioned snapshots. seems like I
was shortsited.
> >Wouldn't it be nice if
2017 Sep 07
2
Samba Recycle Age limit.
Carlos A. P. Cunha via samba wrote:
> For me, is "magic line"
>
> find $DEST -depth -mtime +$DAYS -print -delete
----
I'm guessing you probably want 'ctime' there.
If you use mtime, then it will be deleted "ndays" after
the last modification date on the file -- NOT the time the file
was moved into the recycle bin.
If you use ctime - that
2016 Apr 03
2
Centos7: Mount problem (Unit mnt-bk\x2dbenvet\x2d01.mount is bound to inactive unit dev-disk-by\x2dlabel-bk\x2dbenvet\x2d01.device. Stopping, too.
On Sun, 03 Apr 2016 01:58:42 +0200
Dario Lesca wrote:
> Please, someone can help me to resolve this systemd issue?
systemctl reset-failed
--
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com