apt package repo)?
Thanks again,
Simon
On Thu, 21 Sept 2023 at 17:09, Ivan Krylov wrote:
> On Thu, 21 Sep 2023 10:09:56 +1000
> Simon Knapp wrote:
>
> > I am using R version 4.3.1 (2023-06-16) -- "Beagle Scouts" on ubuntu
> > 20.04
>
> > gcc -std
ce to `main'
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: mgcv.so] Error 1
ERROR: compilation failed for package ‘mgcv’
* removing ‘/home//R/x86_64-pc-linux-gnu-library/4.3/mgcv’
The downloaded source packages are in
‘/tmp/RtmpI7uMoa/downloaded_pac
.var.ncdf(nc, var.def, i + j*10 + k*100, c(i, j, k),
rep(1, 3))
nc
})
the following do not work:
get.var.ncdf(combined.ncdf)
get.var.ncdf(combined.ncdf, varid='Data')
get.var.ncdf(combined.ncdf, varid=4)
all of which I thought would be equivalent and would give me the same as:
get.var.ncdf(comb
))
setMethod('test', signature(x='Base'), function(x) print('base called'))
setMethod('test', signature(x='Derived'), function(x) {print('derived
called'); callNextMethod()})
d = new('Derived')
test(d)
Produces the output:
[1]
What do you mean by "at x equal zero"?
On Sun, Oct 21, 2012 at 8:37 AM, Adel Powell wrote:
> I am new to R and I am trying to do a monte carlo simulation where I
> generate data and interject error then test various cut points; however, my
> output was garbage (at x equal zero, I did not get .50)
Your question does not seem to make sense - there is no value of -500
in Y (did you mean -10?). Anyway, I think this might work:
which(y==-10 & (x==1 | c(0, x[-length(x)]) == 1 | c(x[-1], 0) == 1))
... though one would think there is a more elegant way
On Wed, Oct 17, 2012 at 10:07 AM, Francesc
in as.POSIXct(d, format = format.string, tz = tz) :
> #object 'd' not found
>
> A.K.
>
>
>
>
> - Original Message -
> From: Simon Knapp
> To: Jeff Newmiller
> Cc: r-help@r-project.org; york8866
> Sent: Tuesday, October 16, 2012 1:32 AM
toDaySecond <- function(date.string, format.string='%d%b%Y:%T', tz='') {
d <- as.POSIXct(d, format=format.string, tz=tz)
sum(mapply(function(f, l) as.numeric(format(d, format=f)) * l,
c('%H', '%M', '%S'), c(3600, 60, 1)))
}
toDaySecond('04MAY2011:08:19:00')
Will calculate the second of th
Anything you put in the folder 'inst' of a package gets copied, as is,
to the installed package once 'everything else' is done (see section
1.1.3 of "Writing R Extensions" - which you read for caveats). Hence
you can create
inst/libs//libs/.dll
where:
- is either 'x64' or 'i386' (or both if you
Yes.
Your looking at R_HOME (the installation directory), not the
"directory of the sources".
On Tue, Oct 16, 2012 at 10:08 AM, BayesForever
wrote:
>
> I am trying to follow the instructions in section 8.2.2 of "Writing R
> extensions", to learn how to call R from C. In this manual and at other
The second and third arguments to ifelse are evaluated for all
elements of x (producing your warnings), then the appropriate elements
of each result are combined based on the (logical) values of the first
argument to ifelse.
On Tue, Oct 16, 2012 at 10:08 AM, Shi, Tao wrote:
> Hi list,
>
> Can som
My guess would be that your running the 32 bit version of R - and
rJava is looking for the 64 bit dll. I'd suggest starting the 64 bit
version of R explicitly (e.g. the 64 bit version of Rgui lives at
/bin/x64/Rgui.exe, whereas the 32 bit version lives at
/bin/i386/Rgui.exe).
On Tue, Oct 16, 2012
frame(Pairid=PairID, Pairiddups=PairIDDuplicates)
#Note that there is a fair bit of redundancy throughout
#your code. A neater way of subsetting your original
#data, for instance, would be:
PairIDdup <- unique(PairID[duplicated(PairID)])
Health2[PairID %in% PairIDdup,]
Have Fun!
Simon Knapp
combined <- data.frame(mnv=my.numeric.vec[df1$fileName], type=df1$type)
sorted <- combined[order(rownames(combined)),]
On Wed, Jul 11, 2012 at 8:38 AM, Adrian Johnson
wrote:
> Hi:
> I am trying to map column names of a matrix to another data frame and
> get values in a different column of data
y(e),
b=thingy(b)
)
)
lm5 <- lm(Distance ~ .^2, data = dat2)
summary(lm5)
On Tue, Jun 26, 2012 at 12:35 AM, Simon Knapp wrote:
> ... but this is tantalisingly close:
>
> dat1 <- with(data.catapult,
> data.frame(
> Distance,
> h=C(h, poly, 1),
wish I knew what it meant.
On Tue, Jun 26, 2012 at 12:18 AM, Simon Knapp wrote:
> They are coding the variables as factors and using orthogonal
> polynomial contrasts. This:
>
> data.catapult <- data.frame(data.catapult$Distance,
> do.call(data.frame, lapply(data.catapul
m not even sure why the results to look like
they do (interaction terms like "a*b" not "a:b" and one level for each
interaction).
Hope that helps,
Simon Knapp
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r
I presume you mean car::scatterplot
A1) plot is a generic function for plotting 'things' and scatterplot
is a specific tool provided by that library
A2) from the documentation one infers that
1) the straight line is a regression line
2) the other lines are produced using loess
provided you get the call to read.table (or perhaps read.csv) right
and presuming that file contains only the image data, you should
be able to say:
r <- raster(as.matrix(read.csv("file.csv")))
extent(r) <- extent(xmin, xmax, ymin, ymax)
and not worry about the projection (if it is plain old deci
First, what was going wrong:
#this creates a character vector, not an object containing your data sets
TOWERS <- c("TOWER1","TOWER2","TOWER3","TOWER4","TOWER5","TOWER6","TOWER7")
for(i in 1:7){
# this creates a variable named "TOWER.i" (not "TOWER.1, TOWER.2,
..., TOWER.7)
# which will ge
Hi All,
This is not really an R question but a statistical one. If someone could
either give me the brief explanation or point me to a reference that might
help, I'd appreciate it.
I want to estimate the mean of a log-normal distribution, given the (log
scale normal) parameters mu and sigma squar
... I just tried fiddling with the appearance settings, and when I uncheck
"Custom Colors" under "Document Tabs", the file names reappear, though I
don't get the coloring I am used to (red for modified, green for
unmodified).
Thanks again,
Simon Knapp
On Mon, Jul 4, 201
any advice on
this?
Thanks in advance,
Simon Knapp
OS: windows7
Arch: 64 bit
R version: 2.13.0 (2011-04-13)
WinEdt version: 5.14 (build 20050701)
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch
library(MASS)
dat <- data.frame(
col1=as.factor(sample(1:4, 100, T)),
col2=as.factor(sample(1:4, 100, T)),
col3=as.factor(sample(1:4, 100, T)),
isi=rnorm(100)
)
dat <- split(dat, as.factor(sample(1:3, 100, T)))
lapply(dat, function(x, densfun) fitdistr(x$isi, densfun), 'normal')
for(k in 1:3) {
eval(do.call('substitute', list(expr=thingy,
env=list(A=as.symbol(paste('b_', k, sep=''))
}
}
}
# would have also worked, but it does not. Can someone please explain why
not?
Simon Knapp
On Tue, Jan 19, 2010 at 1:41
ef(2:3, 2:3)
b[1,1] <- 42 # equivalent to b$set.vals(1,1,42)
b[1:2,2] <- 43
a[1,1] <- 44
a[rep(4, 2), 2:3] <- 45
b # print the sub matrix
a # print the matrix
#test passing sub-matrix to a function
test <- function(x) x[2,1] <- 46
test(b)
a # print the matrix again (it is as we
Never used coplot, but why not try removing the rows with missing variables?
Perhaps with:
dat <- cbind(E2=resid(baea.ancova6, type = "normalized"), year, population)
coplot(E2~year|population, data=dat[apply(dat, 1, function(x) !any(is.na
(x))),])
Regards,
Simon Knapp
On Mon, Jan
byrow=T, ncol=6))
# I think this line of code gives what you want (number of rows that contain
at least 1 non-na value).
sum(apply(data[,-1], 1, function(x) any(!is.na(x
# to produce the line "(all)" in your original output (assuming that this
line counts the number of non-na entries
apply(function(y, height, x, width) rect(x, y, x+width, y+height),
cum.heights, heights, MoreArgs=list(cum.tot, width))
text(cum.tot + width/2, heights/2 + cum.heights, x$County)
}, split.dat, cum.widths, widths)
axis(1, (widths / 2 + cum.widths), names(split.dat))
Hope this helps,
Simon Kn
ould do it (but I bet there is a more elegant way).
Regards,
Simon Knapp
On Wed, Jan 13, 2010 at 5:25 AM, Kelvin <6kelv...@gmail.com> wrote:
> Dear friends,
>
> I have a table like this, I have A B C D ... levels, the first column
> you see is just the index, and there are
t(any(apply(temp1, 1, function(x, y) x['geneDescription'] %in% y,
temp2['geneDescription'])), '\n')
}
}
A tip - there are trailing and/or leading whitespace on the variables
'geneDescription' and 'orgSymbol'. (in the latter case " RG "
p*" not found"
Which I think occurs because the last two lines in 'setup' only create
references to their respective environments which disappear on exit of
'setup'.
Any ideas?
Regards,
Simon Knapp.
[[alternative HTML version deleted]]
... actually, the scaling of the weights was not required as it is
done by sample anyway.
On Fri, Dec 19, 2008 at 5:16 PM, Simon Knapp wrote:
> Your code will always generate the same number of samples from each of
> the normals specified on every call, where the number of samples from
>
t; tol) {
warning("data$weight does not sum to 1 - rescaling")
data$weight/sum(data$weight)
} else data$weight
rows <- sample(1:nrow(data), n, T, wgts)
rnorm(n, data$mean[rows], data$sd[rows])
}
Regards,
Simon Knapp.
On Fri, Dec 19, 2008 at 4:14 PM, Bill
mplify=F)
and call it like:
results <- jackknife.apply(1:n, DF, c("(Intercept)", "V1", "V2", "V3"))
which would give you a list with the jackknife output for each coefficient.
note that you don't need to attach DF for your code to work :-)
Regar
Not the same data your using but...
# get something like a reasonable
# age dist for dummy data:
data('mw.ages', package='UsingR')
mw.age <- mw.ages[2:80,]
# size of dummy dataset
n.obs <- 1000
#pr of survival
pr.s <- 0.80
# dummy data
dat <- data.frame(
pclass=sample(c('1st', '2nd', '3rd')
'Rterm --help' shows the usage as:
Rterm [options] [< infile] [>outfile] [EnvVars]
just in case you didn't understand what the angle brackets meant:
the term "[< infile]" means "read input from 'infile'", and
the term "[> outfile]" means "write output to 'outfile'".
Though your code works at th
> I am wondering if there is a function which will do a join between 2
> data.frames by minimum distance, as it is done in ArcGIS for example. For
> people who are not familiar with ArcGIS here it is an explanation:
>
> Suppose you have a data.frame with x, y, coordinates called track, and a
> s
Did you say:
library("tree")
at the top of your script?
On Sun, Sep 14, 2008 at 5:47 PM, Meir Preiszler
<[EMAIL PROTECTED]> wrote:
>
> I am working through Tom Minka's lectures on Data Mining and am now on Day
> 32. The following
> is the link:
> http://alumni.media.mit.edu/~tpminka/courses/36
# bit hard to provide a simple conversion without definitions of the
class 'Node', the template 'DirectedGraph' and the function 'Writed'!
# I've used the package 'igraph' as a drop in - hope it is still clear.
#
# by the way:
# - your curly braces don't match,
# - not all elements of P are initial
is is prettier, but I'm
trying to come to grips with
substitute/do.call/calls/expressions/...). I guess that argument names
are a different beast to argument values in expressions.
My question (finally) is: is there a way of achieving 'desired
result'
41 matches
Mail list logo