Displaying 20 results from an estimated 9000 matches similar to: "simple subtraction in a single vector"
2010 Feb 02
2
Subset and plot
Here is a runable program. When I plot Day and Wgt, it graphs all the data
points. All I need is daily.sub1 plotted. I also need each "Tanks" to have
its own col or pch. When I run it with the line with pch, it gives me
nothing.
rm(list=ls())
Trial<-rep(c(1,2),each=12)
Tanks=rep(c("a3","a4","c4","h4"),each=3,2)
Day=rep(c(1:12),2)
2010 Feb 02
1
Subset and point plot
OK, I need help plotting. I have column headings of Day, Wgt, Foodin, Rep,
Grp and Tanks. Rep=c(1,2,3) and Tanks=c(a1,a2,a3,a4,a5,a6,
c1,c2,c3,c4,c5,c6, h1,h2,h3,h4,h5,h6).
I created a subset where I only would like Rep=2, and Tanks=c(a4,c4,h4) and
would like to graph (points) of Wgt and Day. I would think that I only need
3 colors, but when I run with only 3, only 2 lines show up. When I add
2010 Jan 11
1
Point plot comparisions
I would like to create a point plot with the following two sets of points:
#1 plot(Day,Total) and #2 (Day,cons_hat). Total is the actual value seen
and cons-hat is a predicted value. If possible, I do not want to stack them
as they are quite long. (FYI, I did use the reshape on a previous post,
thanks, but this one is different).
Day Tank Tanks Total cons_hat
1 a a4 5.651017 5.59
2010 Jan 09
1
Boxplots
I have a data set with four columns and need to make boxplots from them.
Data is as follows:
tank Tanks Total cons_hat
1 a a4 5.651017 5.59
2 a a5 5.017499 5.29
3 a a6 4.894238 4.69
4 c c4 3.986347 3.40
5 c c5 4.099442 3.58
6 c c6 4.150522 3.64
7 h h4 5.187792 6.32
8 h h5 6.713422 6.44
9 h h6 5.168555
2009 Jul 15
3
Axes origins and labeling
I have re-labeled tick marks on the x axis. The problem is that by using
axes=FALSE, the axes disappears and when they are called back using
axis(side=1)..etc. the axis on sides 1 and 2 do not meet at the bottom left
corner of the graph. I would also like to have the 3rd and 4th axes in
there as well, all meeting in their respective corners.
par(mfrow=c(1,2))
gut<-c("Full",
2010 Apr 01
2
t.test data in one column
I need a two sample t.test between M and F. The data are arranged in one
column, x. Cant seem to figure how to run a two sample t.test. Not really
sure what this output is giving me, but there should be no difference
between M and F in the example, but summary p-value indicates this.
How can I run a two sample t.test with data in one column.
x=rep(c(1,2,3,4),2)
2009 Oct 19
2
Time Series Data
Hi all and thanks in advance.
I am regressing Time and Weight, and then predicting Weight at
different Time. The format of the Time data is day/month/year. How
can I get R to use time series data such as this?
Keith
--
M. Keith Cox, Ph.D.
Alaska NOAA Fisheries, National Marine Fisheries Service
Auke Bay Laboratories
17109 Pt. Lena Loop Rd.
Juneau, AK 99801
Keith.Cox at noaa.gov
marlinkcox at
2011 Mar 14
2
color under lm line
Hi,
I would like to add a color under a lm line and not the plotted line. Is
this possible? In the example, I do not want the area under the curve red,
but rather under the llm line.
x=seq(0,5,len=100)
y=-(x-5)^2
llm<-lm(y~x)
plot(x,y)
polygon(c(x,x[length(x)]), c(y, y[1]), col='red')
abline(llm)
keith
--
M. Keith Cox, Ph.D.
Alaska NOAA Fisheries, National Marine Fisheries Service
2008 Feb 19
2
addition of matrix
Thank you ahead of time for help with this.
I have two matrices
X
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 660 693.00 726.0 759.00 792.0 825.00
[2,] 548 575.40 602.8 630.20 657.6 685.00
[3,] 676 709.80 743.6 777.40 811.2 845.00
[4,] 763 801.15 839.3 877.45 915.6 953.75
[5,] 768 806.40 844.8 883.20 921.6 960.00
[6,] 692 726.60 761.2 795.80 830.4 865.00
[7,] 657 689.85 722.7
2009 Jul 30
2
wireframe color
Hello, hopefully simple question, but I cannot find the answer. I need to
change the color from the standard default. Still want the scaled colors,
but need different colors for different graphs.
Code is:
wireframe(z ~ y*x, mat.df,
drape = TRUE,
zlab = list("Water mass error (%)",rot=92), zlim=c(-50,180),
xlab = list("Resistance error
2010 Jan 22
1
first and second derivative calculation
I would like to calculate a first and second derivative and am having
problems finding a simple solution. My syntax may be off as I am not a
mathematician, so pardon ahead of time.
data:
t<-seq(0,4, by=.1)
The function is:
H(t) = t^3-6*t^2+5*t + 30
from here I plot the curve:
plot(x,y ,xlab="x-values", ylab="f(x)", type="l")
But would like to similarly plot the
2008 Apr 22
1
subset and boxplots
R users,
This should be simple, but I cannot figure it out. I import test.csv, then
create a subset for "brook_dis". When I plot (week, R) I get a nice
boxplot, but along the x axis, there are weeks a, b, c along with h and nh.
Thank you ahead of time. keith
rm(list=ls())
cond.exp1<-read.csv("condition/test.csv",header=TRUE)
sub<-subset(cond.exp1,
2003 Sep 25
1
apply on a 4D array
I am trying to multiply a 3D array of 4x4x4 by the 4 3D arrays of a 4D array
with dimensions 4x4x4x4 (the last dimension being the one that I want to
split by).
(4x4x4 array)
> hiaAry
, , a1
i1 i2 i3 i4
h1 9.5936098 6.001040 0.08772 0.3138600
h2 1.2003500 1.454570 2.79248 0.0000000
h3 0.1346500 0.201220 0.39256 0.5464000
h4 0.0109000 0.012270 0.16417 0.2766900
,
2009 Jul 16
1
axis label config mgp
I have long axis labels (8units) on the x axis and 2 unit number labels on
the y axis. I need to move the x axis title without moving the y axis
title. I have used mgp=c(title, label and line), but mgp moves both the x
and y titles. The following puts the y axis title way way out to the left.
Anyone know how to move just the x axis.
X11()
conif<-c("Control", "Switched
2010 Sep 02
1
NLS equation self starting non linear
This data are kilojoules of energy that are consumed in starving fish over a
time period (Days). The KJ reach a lower asymptote and level off and I
would like to use a non-linear plot to show this leveling off. The data are
noisy and the sample sizes not the largest. I have tried selfstarting
weibull curves and tried the following, both end with errors.
Days<-c(12, 12, 12, 12, 22, 22, 22,
2008 Dec 09
1
creating standard curves for ELISA analysis
Hello R guru's
I am a newbie to R, In my research work I usually generate a lot of ELISA
data in form of absorbance values. I ususally use Excel to calculate the
concentrations of unknown, but it is too tedious and manual especially when
I have 100's of files to process. I would appreciate some help in creating
a R script to do this with minimal manual input. s A1-G1 and A2-G2 are
2010 Sep 27
2
subtraction based on two groups in a dataframe
Hello
I have a data set like below:
plate.id well.id Group HYB rlt1
1 P1 A1 Control SKOV3hyb 0.190
2 P1 A2 Control SKOV3hyb 0.210
3 P1 A3 Control SKOV3hyb 0.205
4 P1 A4 Control SKOV3hyb 0.206
5 P1 A5 Control SKOV3hyb 0.184
385 P1 A1 ovca SKOV3hyb 0.184
386 P1 A2 ovca SKOV3hyb 0.229
387
2008 Feb 15
2
wire.frame tick labels from matrix
Dear R Users, close to the end of this I used wireframe to create a 3D plot
from a matrix. The x and y axis tick labels (1-6) for each were created
from the matrix being a 6X6 matrix. I need the axis tick labels to be the
row and column headings which you can see in the output (mat.x). I have
tried several work arounds, but they have not been successful.
Thanks in advance. keith
rm(list=ls())
2005 Aug 15
2
queer data set
I have a dataset that is basically structureless. Its dimension varies
from row to row and sep(s) are a mixture of tab and semi colon (;) and
example is
HEADER1 HEADER2 HEADER3 HEADER3
A1 B1 C1 X11;X12;X13
A2 B2 C2 X21;X22;X23;X24;X25
A3 B3 C3
A4 B4 C4 X41;X42;X43
A5 B5 C5 X51
etc., say. Note that a blank
2017 Oct 09
3
Merge me agrega siempre las columnas
Buenas,
Tengo dos data.frames de la siguiente manera
library(data.table)
id<-c("a1","a2","a3","a4")
id2<-c("a2","a3","a1","a4")
y<-c(1,2,3,4)
z<-c(3,5,6,7)
k<-c(1,3,8,7)
df1<-data.table(id,y,z)
id<-c("a2","a3","a1","a4")
df2<-data.table(id,x,y)
Quiero