Displaying 20 results from an estimated 8000 matches similar to: "Create histogram from data matrix"
2009 Apr 10
1
Subset a data frame for plotting
Hello,
I have a question regarding how to subset/select parts of a data
frame (matrix) in order to plot data associated only with this subset.
Specifically I have a large data frame in which one column contains ID
values (dates), and other columns contain data I would like to plot
(temperature, light, etc.). I would like to break up this large matrix
so as to plot data associated
2005 Feb 16
5
scaling axes when plotting multiple data sets
1) When adding additional data sets to a plot using "plot" followed by "lines",
is there a way to automate the scaling of the axes to allow for all data sets
to fit within the plot area?
2) I attempted to solve this by setting
xlim=c(min(c(data1,data2,data3)),max(c(data1,data2,data3)))
however, there are some NAs and Infs in these data sets, and min(data1) and
max(data1) both
2004 Nov 22
2
variable object naming
Is it possible to give a temporary object a name that varies with each run of a
foreloop? For example, I want to fill a matrix every time I run a loop, and I
want a new matrix with each run, with an appropriate new name.
i.e.:
for(i in 1:5){... matrix.i<-some values ...}
so that in the end I would have:
matrix.1
matrix.2
matrix.3
matrix.4
matrix.5
Thanks,
Ben Osborne
--
Botany Department
2005 Mar 01
1
na.strings in readLines or is.na?
When reading a data set into R using readLines, na.strings="-99.99" is ignored.
Is there an equivalent command for readLines? Alternatively, either
immediately after reading into R or once the data set has been converted to a
data frame, what is the appropriate command (or appropriate use of is.na) to
convert my -99.99s to NAs?
Thanks,
Ben Osborne
--
Botany Department
University of
2004 Dec 04
1
AIC, AICc, and K
How can I extract K (number of parameters) from an AIC calculation, both to
report K itself and to calculate AICc? I'm aware of the conversion from AIC ->
AICc, where AICc = AIC + 2K(K+1)/(n-K-1), but not sure of how K is calculated
or how to extract that value from either an AIC or logLik calculation.
This is probably more of a basic statistics question than an R question, but I
thank
2005 Apr 18
1
R-squared in summary(lm...)
What is the difference between the two R-squareds returned for a linear
regression by summary(lm...)? When might one report multiple vs. adjusted
R-squared?
Thank you,
Ben Osborne
--
Botany Department
University of Vermont
109 Carrigan Drive
Burlington, VT 05405
benjamin.osborne at uvm.edu
phone: 802-656-0297
fax: 802-656-0440
2004 Dec 13
1
AIC, glm, lognormal distribution
I'm attempting to do model selection with AIC, using a glm and a lognormal
distribution, but:
fit1<-glm(BA~Year,data=pdat.sp1.65.04, family=gaussian(link="log"))
## gives the same result as either of the following:
fit1<-glm(BA~Year,data=pdat.sp1.65.04, family=gaussian)
fit1<-lm(BA~Year,data=pdat.sp1.65.04)
fit1
#Coefficients:
#(Intercept) Year2004
# -1.6341
2004 May 08
1
Installing R 1.9.0 on OSX
I've downloaded and installed R 1.9.0 under OS X 10.3.3. I then
removed my previous R 1.8.0 installation by following the
instructions in the readme file, e.g.,
1. drag the "StartR" icon into the Trash;
2) go inside your Home directory and search for the Library folder.
Inside the Library folder in your Home directory you'll
find a RAqua directory: drag the RAqua
2003 Dec 11
2
Failed installation on Mac OSX 10.3 (PR#5697)
I've installed R 1.8.1 on OSX 10.3 (Panther) using the RAqua.pkg and
all indications were that the installation was successful. However,
after double clicking the R icon in the Applications folder, nothing
appears to happen. The following message appears on the console:
Mac OS X Version 10.3 (Build 7B85)
2003-12-11 08:45:31 -0500
prefs written
dyld:
2003 Dec 11
2
Failed installation on Mac OSX 10.3 (PR#5697)
I've installed R 1.8.1 on OSX 10.3 (Panther) using the RAqua.pkg and
all indications were that the installation was successful. However,
after double clicking the R icon in the Applications folder, nothing
appears to happen. The following message appears on the console:
Mac OS X Version 10.3 (Build 7B85)
2003-12-11 08:45:31 -0500
prefs written
dyld:
2005 Jun 10
1
Fortran compilation error
Hello,
I'm trying to install a package that requires a Fortran compiler
(Hmisc) using R CMD INSTALL. I downloaded the package source onto my
Desktop, unzipped it, and then typed:
R CMD INSTALL /Users/brianbeckage/Desktop/Hmisc
* Installing *source* package 'Hmisc' ...
** libs
g77 -fno-common -g -O2 -c cidxcn.f -o cidxcn.o
g77 -fno-common -g -O2 -c cidxcp.f -o cidxcp.o
g77
2004 Aug 09
4
Simultaneous subscripts and superscripts
Dear List,
I'd like to add text to a plot where a text symbol has both a
superscript and subscript. For example, the variable S with a
superscript 2 and a subscript t. I have been able to accomplish this
using either
expression( paste(S,atop(scriptstyle(2),scriptstyle(t))) )
or
expression( {S[t]}^2 )
but the spacing isn't quite right (or rather what I'd like) using
either of
2004 Jan 14
2
nonlinear regression and Excel solver
Hi all,
Earlier today I posted this question on s-news, so apologies to some for
the duplication.
> Please put aside your snobbery about Microsoft products for a moment.
>
> I am fitting population models to annual survey data for trout. For those of you familiar with ecological models, I am working in the Lefkovitch matrix framework; for those unfamiliar with that shorthand, the
2004 Mar 05
3
as.POSIXct problem
Hi all,
I'm having difficulty converting a 'dates' object to a POSIXct object:
testDATES<-c(35947,35971,36004,36008,36053,36066)
testDATES<-chron(dates=testDATES, format = c(dates = "m/d/y"),
origin=c(month = 12, day = 30, year = 1899))
>[1] 06/01/98 06/25/98 07/28/98 08/01/98 09/15/98 09/28/98
> as.POSIXct(testDATES)
[1] NA NA NA NA NA NA
2012 Dec 05
1
loading & using Ryacas
I'm having trouble loading Ryacas. I've downloaded and extracted Ryacas
0.2-9 (also tried Ryacas ) and yacas 1.0.63, have the latest version of R
and have tried the following (this works for installing other packages):
install.packages("Ryacas")
library(Ryacas)
install.packages("yacas")
library(yacas)
and get this:
Warning message:
package ‘yacas’ is not available
2009 Nov 19
2
Calling R (GAMM) from Fortran
Hello,
I am currently working on a modeling project using Fortran to run
large repetitive loops (many DO loops). As part of this process I
would like to use a model fit in R and currently stored as an R
object. This is a rather complex model, a GAMM, and I am curious
whether there is a way to call this model from Fortran. I am not sure
"call" is correct terminology, but I
2004 Oct 09
1
functions
Does anyone know of a list of functions that R already "knows?" I can't seem to
find this anywhere in the help documentation. For example, I want to count the
number of occurences of a certain value in a column of a data frame: What do I
have to do to tell R to "Count?"
Thanks,
Ben Osborne
--
Botany Department
University of Vermont
109 Carrigan Drive
Burlington, VT 05405
2009 Sep 23
5
Fortran vs R
Hello R users,
I have a basic "computer programing" question. I am a student
currently taking a course that uses Fortran as the main programming
language, but the instructors are open to students using any language
they are familiar with. I have used R previously, and am wondering if
there is any benefit to my learning Fortran, or whether I should stick
with R for this class. Any
2009 Jun 17
2
GAM function with interaction
Hello R Users,
I have a question regarding fitting a model with GAM{mgcv}. I have
data from several predictor (X) variables I wish to use to develop a
model to predict one Y variable. I am working with ecological data, so
have data collected many times (about 20) over the course of two years.
Plotting data independently for each date there appears to be
relationships between Y (fish
2012 Dec 04
1
Solve system of equations (nleqslv) only returns origin
I'm solving 4 complex equations simultaneously. Code is below. The code
returns only zero's for the solution though there should also be a non-zero
result. I'm pretty confident that the equations are correct because they
are straight from a published paper and I checked them pretty thoroughly.
The parameter values I used are from the published paper as well. Any
suggestions for how