similar to: Convert char vector to numeric table

Displaying 20 results from an estimated 4000 matches similar to: "Convert char vector to numeric table"

2003 Mar 24
1
using tapply with a matrix?
I've successfully created my own function (topbot) that takes a vector as input and used it with tapply() and an input vector (data$depth) and classification factor (data$profile): vols <- tapply(data$depth, data$profile, topbot) works great. But now I want to do something similar, except my function will take a 3 column matrix with nrows() equal to the factor's length. tapply
2003 May 15
1
Manly's randomization analysis of multiple regression
My wife has been using a diagnostic from Manley (1991; "Randomization and MonteCarlo Methods in Biology") that compares a normal multiple regression's performance with that using random predicted variables. Is there something like this already available in R? If not, the "boot" package looks like a good place to start looking for methods, no? Thanks in advance Bruce
2003 Aug 09
1
lm(), na.exclude and predict()
I'm trying to get predict.lm() to return an NA for each NA row in it's input vector, so the output is the same length as the input. I thought that using na.action=na.exclude with lm() would do that. But apparently not ?? df <- data.frame(x=c(NA,1,2,3,NA),y=c(0,2,3,4,0)) tl <- lm(y~x,df,na.action=na.exclude) predict.lm(tl,data.frame(x=c(2.5,NA,3,4,5))) 1 3 4 5 3.5 4.0 5.0
2013 Feb 20
2
xyplot help
I am ploting gridded time series data. I would like the actual lat and lon value appear on the graph-if possible inside the graph as numbers. If there is also more elegant ways to plot the graphs I will appreciate more suggestions. ################################# library(ggplot2) library(lattice) month <- c("Jan", "Feb", "Mar", "Apr", "May",
2013 Feb 22
3
Help xyplot
Hi Mackay and anybody (a) Is it possible to select randomly (let say five grids) and plot? (b) Is it possible to plot five nearest grid in one figure? The original question and improved codes: #I am ploting gridded time series data. I would like the actual lat #and lon value appear on the graph-if possible inside the graph as #numbers. If there is also more elegant ways to plot the graphs I
2001 May 09
1
Fortran subroutines dblepr, realpr, intpr
I am making my first attempts at using some Fortran code with R, and so far it's going OK. To print from my Fortran programs, it seems I need subroutines dblepr, realpr and intpr. From the excellent "Writing R Extensions" document: "Three subroutines are provided to ease the output of information from FORTRAN code. subroutine dblepr(label, nchar, data, ndata)
2007 Feb 27
1
interactions and GAM
Dear R-users, I have 1 remark and 1 question on the inclusion of interactions in the gam function from the gam package. I need to fit quantitative predictors in interactions with factors. You can see an example of what I need in fig 9.13 p265 from Hastie and Tibshirani book (1990). It's clearly stated that in ?gam "Interactions with nonparametric smooth terms are not fully
2005 Mar 07
1
Density estimation when an end may not go to zero?
All the density estimators I've found in R seem to force the ends to go to zero. What can we do if we don't believe that, e.g., with something that might be a uniform distribution or a truncated normal with only observations above mu+sigma observed? The closest I could come to this was to artificially extend the numbers beyond the range, thereby forcing the density estimator
2007 May 18
1
partial correlation significance
Hi, among the many (5) methods that I found in the list to do partial correlation in the following two that I had a look I am getting different t-values. Does anyone have any clues on why is that? The source code is below. Thanks. pcor3 <- function (x, test = T, p = 0.05) { nvar <- ncol(x) ndata <- nrow(x) conc <- solve(cor(x)) resid.sd <- 1/sqrt(diag(conc)) pcc <-
2003 Mar 15
3
round() seems inconsistent when rounding 5s
It may be my lack of unerstanding, but round() seems to me to give inconsistent results when rounding 5s as in the following examples? > round(1.45, 1) [1] 1.4 # OK > round(2.45, 1) [1] 2.5 # shouldn't this be 2.4? > round(1.05, 1) [1] 1.1 # 1.0 ? and signif(): > signif(2.445, 3) [1] 2.44 # OK > signif(3.445, 3) [1]
2010 Jun 30
1
(no subject)
>From 1db8a8919482dbed4cc15509d8078b2f16a289bb Mon Sep 17 00:00:00 2001 From: Gert Hulselmans <gerth at zytor.com> Date: Wed, 30 Jun 2010 14:10:23 +0200 Subject: [PATCH] chain.c32: add grubcfg= for passing an alternative config filename to GRUB Legacy GRUB Legacy reserves 89 bytes for storing the filename of the configfile from memory address 0x8217 to 0x826f. We allow overwriting the
2005 Nov 04
1
problem in waveslim library?
This code consistenly segfaults for me. Can someone please take a look and tell me if the problem is due to something I am doing or is there a problems with the dwt (idwt) functions in the waveslim library. Thanks tom library(waveslim)
2010 Dec 21
2
[PATCH] chain.c32: support chainloading GRUB2 core.img
Here is a patch that makes it possible to chainload GRUB2 core.img form chain.c32. It reuses the grub= parameter (used for chainloading GRUB Legacy stage2): - both loaded at 0x8000 - start execution at offset 0x200 (0x8200 in memory) GRUB2 allows to specify another "GRUB home dir" than the standard /boot/grub GRUB2 doesn't allow to change the configfile 'grub.cfg' name
2017 Nov 22
3
Chan Local, Originate and slin
Hi all! Asterisk 13.1.0 Ubuntu 16.04, all latest. Can anybody explain this to me - I run Originate command from dialplan: same => n,Originate(Local/${number}@mycontext,app,ConfBridge,${confnum}) and I get crazy sound distortion in the conference, and I see that transcoding takes place here: NativeFormats: (slin192) WriteFormat: slin ReadFormat: slin192 WriteTranscode: Yes (slin
2009 Aug 12
1
what is the difference between the two logistic models?
Hi All, I have data with 400 individuals and the following information Grade: pass or fail coded as 1 for pass and 0 for fail Sex: male or female ( coded as 1 for male and 2 for female ) Age Teaching.method : can be 1,2,3 I want to fit a logistic regression where the outcome if (1=pass or 0 for fail) and the rest of the variables are the regressors. My question is that I am not sure
2010 Jun 17
2
Multiple plots in a single page and stripplot()
I want to make a 2x2 plot on a single page, using stripplot() and boxplot(). I tried the following two alternatives with mfrow() and layout(), but none of them worked. library(lattice) par(mfrow=c(2,2)) boxplot(X1 ~ Y, data=tst1, horizontal=T, las=1) boxplot(X2 ~ Y, data=tst1, horizontal=T, las=1) stripplot(Y ~ X1, data=tst1) stripplot(Y ~ X2, data=tst1) par(mfrow=c(1,1)) nf <-
2017 Nov 22
2
Chan Local, Originate and slin
On Wed, 22 Nov 2017, Dmitriy Serov wrote: > ?same => n,System(printf "Action: Originate\nActionID: 1\nChannel: Local/${number}@mycontext\nApplication: Confbridge\nData: ${confnum}\n" > > /var/spool/asterisk/outgoing/${number}-${confnum}) I get: Unknown keyword 'Action' at line 1 of /var/spool/asterisk/outgoing/... Unknown keyword 'ActionID' at line 2 of
2010 Apr 20
2
having more than one plot in one figure
Hi All, I have been trying to plot multiple line plots with different colors on one figure. in my example below I was able to plot cat vs num1 as a dot plot connected with lines but was not able to do that for cat vs num2 and I do not know how to add the third plot cat vs num3. below is my code df <- data.frame(cat=1:10, num1=rnorm(10), num2=rnorm(10), num3=rnorm(10)) plot(df$num1,
2010 May 07
3
[LLVMdev] AsmPrinter behavior
I compile these two lines in llc @tst1 = internal global [4 x i8] zeroinitializer; @tst2 = internal global [4 x i8] [i8 0, i8 1, i8 2, i8 3]; @tst1 is emited via MCStreamer::EmitCommonSymbol while the other is emited via MCStreamer::EmitLabel followed by MCStreamer::EmitBytes from what I can tell, only symbols with common linkage should me emitted by MCStreamer::EmitCommonSymbol, is this the
2013 Apr 09
1
(no subject)
Hi I would like to normalize my data by one of the variables in long format. My data is like this: > t1<-data.frame(id=rep(1:3,rep(3,3)),dt=rep(1:3,rep(9,3)),var=c('num1','num2','norm'),value=rnorm(27)) > t1 id dt var value 1 1 1 num1 -1.83276256 2 1 1 num2 1.57034303 3 1 1 norm 0.60008563 4 2 1 num1 -0.96893477 5 2 1 num2 0.30423346 6