Displaying 20 results from an estimated 4000 matches similar to: "Smooth line in graph"
2013 May 15
1
x and y lengths differ
I have a problem with R. I try to compute the confidence interval for my
df. When I want to create the plot I have this problem: Error in
xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ.
I try this code:
library(dplR)
df.rwi <- detrend(rwl = df, method = "Spline",nyrs=NULL)
write.table(df.rwi,file="rwi.txt",quote=FALSE,row.names=TRUE)
2012 Jul 30
2
distance matrix and hclustering
Dear R Users,i am very new to R. I want your help on an issue regarding distance matrix and cluster analysis
i had discharge data of 4 rivers(a,b,c,d) in 4 vectors each having 364 values
> dput(qmu)structure(list(a = c(0.26, 0.25, 0.25, 0.25, 0.24, 0.23, 0.22, 0.21, 0.21, 0.21, 0.2, 0.19, 0.19, 0.19, 0.19, 0.18, 0.18, 0.18, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17, 0.17,
2016 Mar 04
2
R 3.2.4 rc issue
I generally run 'make; make check' (with more settings) when building the
Debian package. Running 3.2.4 rc from last night, I see a lot of package
loading issues during 'make check'. Here is splines as one examples:
checking package 'splines'
* using log directory '/build/r-base-3.2.3.20160303/tests/splines.Rcheck'
* using R version 3.2.4 RC (2016-03-02 r70270)
*
2009 Feb 26
2
interpSpline with dates?
Dear R-helpers,
can I use a POSIXct date as the x variable in interpSpline? The help
page says x and y need to be numeric... is there a workaround?
example:
library(splines)
testdfr <- data.frame(Date=seq(as.POSIXct("2008-08-01"),as.POSIXct("2008-09-01"),
length=10))
testdfr$yvar <- rnorm(10)
sp <- interpSpline(yvar ~ Date, testdfr)
preddfr <-
2007 Jul 04
3
Problem/bug with smooth.spline and all.knots=T
Dear list,
if I do
smooth.spline(tmpSec, tmpT, all.knots=T)
with the attached data, I get this error-message:
Error in smooth.spline(tmpSec, tmpT, all.knots = T) :
smoothing parameter value too small
If I do
smooth.spline(tmpSec[-single arbitrary number], tmpT[-single arbitrary number], all.knots=T)
it works!
I just don't see it. It works for hundrets other datasets, but not for
2006 Jul 31
1
questions regarding spline functions
Greetings,
A couple general questions regarding the use of splines to interpolate depth
profile data.
Here is an example of a set of depths, with associated attributes for a given
soil profile, along with a function for calculating midpoints from a set of
soil horizon boundaries:
#calculate midpoints:
mid <- function(x) {
for( i in 1:length(x)) {
if( i > 1) {
a[i] = (x[i] -
2009 Jan 06
3
smoothed contour lines
Hi all,
I'm trying to draw a contour plot
with rounded (smoothed) contour lines instead of sharp angles;
when the grid consists of only a few points
in x- and y- axis, the resulting contour
is in facts rather ugly since very sharp angles may appear.
I did not find any way to do it,
by using either "contour" or "contourplot" (from the lattice package),
I wonder if there
2010 Sep 14
1
predict(backSpline(x)): losing my marbles?
I'm sure I'm doing something completely boneheaded here, but I've
used this idiom
(constructing an interpolation spline and using prediction from a
backSpline to find
an approximation profile confidence interval) many times before and
haven't hit this
particular problem:
r2 <- c(1.04409027570601, 1.09953936543359, 1.15498845516117,
1.21043754488875,
2008 Dec 27
1
contour plot - smooth lines
Dear R-Users,
I am using 'contour' to plot a graph using values x,y and a matrix z.
I would like to obtain 'smooth lines' instead of no-smooth contour lines.
I tried with filled.contour too.
In a Post I found
yy <-predict(interpSpline(x, y))
I could use that method for each range that I want to plot but I hope
to find a easier method.
Thank you
Tommaso Letterio
DIAF - UniFi
2000 Sep 04
2
bug in spline()? (PR#653)
BUG IN SPLINE()?
Version R-1.0.1, system i486,linux
If the spline(x,y,method="natural") function is given values outside the
range of the data, it does not give a warning. Moreover, the extrapolated
value reported is not the ordinate of the natural spline defined by (x,y).
Example. Let x <- c(2,5,8,10) and y <- c(1.2266,-1.7606,-0.5051,1.0390).
Then interpolate/extrapolate with
2013 May 23
1
sample(c(0, 1)...) vs. rbinom
Greetings.? My wife is teaching an introductory stat class at UC Davis.? The
class emphasizes the use of simulations, rather than mathematics, to get
insight into statistics, and R is the mandated tool.?? A student in the class
recently inquired about different approaches to sampling from a binomial
distribution.? I've appended some code that exhibits the idea, the gist of
which is that using
2010 Nov 01
6
connecting points into a smooth curve
If I have, say, five scatter points and want to connect them together into a
smooth curve.
I did plot(x,y,type="l"), but the graph is five segments connecting with
each other, but not a smooth curve.
I wonder if there is a line type that is a curve. Thanks!
--
View this message in context: http://r.789695.n4.nabble.com/connecting-points-into-a-smooth-curve-tp3021796p3021796.html
Sent
1998 Apr 07
3
R-beta: spline problems(?)
Hi,
I am a total beginner with this whole thing so please have patience!
I am trying to run an S-plus program with a certain line:
spline(1:nrow(y), y[,1],n=100);
This crashes with:
Error: NAs in foreign function call (arg 8)
Apparently, this is caused by the last command of spline:
u <- seq(xmin, xmax, length.out = n)
.C("spline_eval", z$method, length(u), x = u, y =
2012 Sep 28
2
Converting array to matrix
Hi,
I have a 3d array as below, I want to make this array to a matrix of p=50(rows) and n=20(columns) with the coverage values .
The code before the array is:
library(binom)
Loading required package: lattice
pi.seq<-seq(from = 0.01, to = 0.5, by = 0.01)
no.seq<-seq(from = 5, to = 100, by = 5)
cp.all = binom.coverage( p = pi.seq, n = no.seq , conf.level = 0.95, method = "exact")
2008 Dec 04
1
xspline, graphical parameters and MAXNUMPTS
Hello,
I am having two difficulties with xspline:
1) Passing lty=2 (via ...) appears to have no effect
2) Apparently depending on the current plot axes, I may or may not
get the failure: add_point - reached MAXNUMPTS (25200)
This happens both on Linux/R 2.8.0 (details below) and Windows Vista/R
2.8.0 patched (2008-10-21 r46766)
Simplest case:
plot(c(0,1),c(0,1))
2011 Jul 28
3
smooth scatterplot and geo map
Hello everybody,
I'm trying to understand how to draw a smoothed scatterplot on a geographic
map with R.
Have a dataframe with point locations (long, lat) and was able to simply
plot these points on a shp map by using the maptools package. However,
instead of having simply the raw points on the map, I would like to have a
"smoothed" scatterplot of the same superimposed on the map.
2010 Mar 31
1
Weird R behaviour?
Dear list,
I have observed a weird behaviour from R --- apologies if I am missing
something obvious!
df3f826f28
df3f826f28
Say you type in R:
>c.preec <- 10074
>c.gd <- 2200
>p1 <- .2
>c.neo <- p1*9451 + (1-p1)*3883
>n.preec <- 3710
>n.gd <- 2650
>n.neo <- 2120
>n.pcos <- 53000
>unit.met <- 94
>cost.met <- 94*n.pcos
>effect <-
2001 Sep 01
2
interpolation and numerical differentiation in R ?
Hi,
I'm trying to determine if R is useful to me. I've browsed 'The Basics of
S and S-Plus' (Krause & Olson), and like the logic of the language.
However, I don't see an easy way to do things like this:
* given a set of observations (x,y) (x and y equal-length vectors), and a
2nd set of abscissas x2, interpolate y at the new abscissas x2. (for now,
I don't really
2008 Feb 08
1
xspline(..., draw=FALSE) fails if there is no open device (PR#10727)
Full_Name: Jari Oksanen
Version: 2.6.2 RC (2008-02-07 r44369)
OS: Linux
Submission from: (NULL) (130.231.102.145)
Even if function xspline() is called with argument draw=FALSE, it requires a
graphics device (that it won't use since it was draw=FALSE). I run into this
because I intended to use xspline within a function (that does not yet draw:
there is plot method for that), and the function
2005 Aug 03
3
clara - memory limit
Dear all,
I'm trying to estimate clusters from a very large dataset using clara but the
program stops with a memory error. The (very simple) code and the error:
mydata<-read.dbf(file="fnorsel_4px.dbf")
my.clara.7k<-clara(mydata,k=7)
>Error: cannot allocate vector of size 465108 Kb
The dataset contains >3,000,000 rows and 15 columns. I'm using a windows
computer