similar to: I need help making a data.fame comprised of selected columns of an original data frame.

Displaying 20 results from an estimated 200 matches similar to: "I need help making a data.fame comprised of selected columns of an original data frame."

2010 Jul 16
1
Troubles with DBI's dbWriteTable in RMySQL
I am feeling rather dumb right now. I created what I thought was a data.frame as follows: aaa <- lapply(split(moreinfo,list(moreinfo$m_id),drop = TRUE), fun_m_id) m_id_default_res <- do.call(rbind, aaa) print("==========================================") m_id_default_res print("==========================================") ndf <- m_id_default_res[, c('mid',
2010 Jul 22
1
How do I get rid of list elements where the value is NULL before applying rbind?
Here is the function that makes the data.frames in the list: funweek <- function(df) if (length(df$elapsed_time) > 5) { res = fitdist(df$elapsed_time,"exp") year = df$sale_year[1] sample = df$sale_week[1] mid = df$m_id[1] estimate = res$estimate sd = res$sd samplesize = res$n loglik = res$loglik aic = res$aic bic = res$bic chisq =
2010 Jul 21
0
One problem with RMySQL and a query that returns an empty recordset
My last query related to this referred to a problem with not being able to store data. A suggestion was made to try to convert the data returned by fitdist into a data.frame before using rbind. That failed, but provided the key to solving the problem (which was to create a data.frame using the variables fitdist produces in the object it returns). I now have almost everything working as
2010 Jul 08
1
Query about using timestamps returned by SQL as 'factor' for split
I have a simple query as follows: "SELECT m_id,sale_date,YEAR(sale_date),WEEK(sale_date),return_type,DATEDIFF(return_date,sale_date) AS elapsed_time FROM risk_input" I can get, and view, all the data that that query returns. The question is, sale_date is a timestamp, and I need to call split to group this data by m_id and the week in which the sale occurred. Obviously, I would
2013 Jun 18
1
install a package made using bioconductor package pdInfoBuilder
Dear maintainer, I used bioconductor package, pdInfoBuilder, to make a microarray platform annotation package. I named this package, pd.pdinfo.gpl11164.ndf.txt. This "self-made package" is to be used with oligo package. Prior to using oligo package, I need to install the annotation package, pd.pdinfo.gpl11164.ndf.txt, and cannot just copy it to the library tree. I tried using the
2009 Apr 16
2
Translate the elements of a dataframe
The second beginner question. I want to create a new dataframe, where each element of the original dataframe is translated to 1 if it was "+", to 0 if it was "-" to -1 otherwise. I could do with: Lines <- "a b c d + - + + + + + - + 1 - '+ ' - + + + + N - +" DF <-
2009 May 31
1
Error:non-numeric argument in my function
Hello! I have a function: zywnoscCalosc<- function( jedzenie, n1, n2, n3, n4, d1, d2, d3, d4 ) { ndf <- data.frame(nn1=n1,nn2=n2,nn3=n3,nn4=n4) ddf <- data.frame(dd1=d1,dd2=d2,dd3=d3,dd4=d4) for (i in 1:length(n1)){ wekt_n = ndf[i,] wekt_n_ok = wekt_n[!is.na(wekt_n)] dl_n = length(wekt_n_ok) wynik = (1*wekt_n_ok)/(1*dl_n) } } and I get an error like this: Error in 1 * wekt_n_ok :
2009 Jun 02
2
What do you think about my function?
Hello, I want to know what do you think about my function. I know that it isn't briliant :/ but what do you think? What I should do that my function will be better? (now is very slow and not ideal, sometimes I also get a mistake!) ########## My function ############################################# dzieci<-transform(dzieci, zywnosc=0) zywnoscCalosc<- function( jedzenie, sklep, n1, n2,
2009 Feb 26
1
using predict method with an offset
Hi, I have run into another problem using offsets, this time with the predict function, where there seems to be a contradiction again between the behavior and the help page. On the man page for predict.lm, it says Offsets specified by offset in the fit by lm will not be included in predictions, whereas those specified by an offset term in the formula will be. While it indicates nothings about
2008 Dec 03
1
function qt can fails if ndf < 1 (PR#13364)
Full_Name: Gerard Torrent Version: R version 2.8.0 (2008-10-20) OS: Linux 2.6.27.5-41.fc9.x86_64 #1 SMP Submission from: (NULL) (85.52.227.233) In some cases qt complains about NaNs and don't gives the correct result: > qt(0.1,, 0.1) [1] NaN Warning message: In qt(p, df, lower.tail, log.p) : NaNs produced But the result can be found: > pt(-1.60443e+06, 0.1) [1] 0.09999997 If I
2010 Sep 24
1
How to change the lengend in a DA figure
Dear all: I have encountered a problem recently: I used to plot figure, and using code "main="......", xlab=".....",ylab="....." to change the legend. But recently I was using R to perform Discriminant Function analysis, and I want to change the group names also add a title to the figure, but I am not sure how to make it work, could you please help me with my
2013 Feb 12
0
error message from predict.coxph
In one particular situation predict.coxph gives an error message. Namely: stratified data, predict='expected', new data, se=TRUE. I think I found the error but I'll leave that to you to decide. Thanks, Chris ######## CODE library(survival) set.seed(20121221) nn <- 10 # sample size in each group lambda0 <- 0.1 # event rate in group 0 lambda1 <- 0.2 # event rate in group 1
2012 Oct 22
2
Problem installing ndf library
Hello, I am a new user of R and Linux (debian squeeze), and I am trying to install the ncdf library. First I don't know wich is the best to use (ncdf or ncdf4), But not matter the one I tried to install, it always failled. I try to find a solution to this common problem on the web, but I never find the good way to solve it. I hope you could help me I try many things during two days and now I
2011 Mar 09
2
rms: getting adjusted R^2 from ols object
How can I extract the adjusted R^2 value from an ols object (using rms package)? library(rms) x <- rnorm(10) y <- x + rnorm(10) ols1 <- ols(y ~ x) Typing "ols1" displays adjusted R^2 among other things, but how can I assign it to a variable? I tried str(ols1) but couldn't see where to go from there. Thanks, Mark Seeto
2015 Nov 09
0
[PATCH v2 1/5] debugfs: add infrastructure to add files with other fops than only read
v2: use the same object for private data as with the drm debugfs functions Signed-off-by: Karol Herbst <nouveau at karolherbst.de> --- drm/nouveau/nouveau_debugfs.c | 54 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/drm/nouveau/nouveau_debugfs.c b/drm/nouveau/nouveau_debugfs.c index 5392e07..fe53743 100644 ---
2006 Mar 13
1
Formatting an anova table using latex
Hi r-helpers, When I issue the command latex(anova(raw1.lmer0, raw1.lmer, raw1.lmerI), file = 'raw1.tex', rownamesTexCmd = c('baR', 'addit', 'multip'), longtable = F, dcolumn = T, booktabs = T, t able.env = F, colheads = NULL, colnamesTexCmd = c ('', 'df', 'aic', 'bic', 'logl', 'chisq', 'chisqdf',
2005 Feb 21
2
power.anova.test for interaction effects
This question will probably get me in trouble on theoretical grounds, but I will pose it anyway. The situation: I recently ran a field study looking for differences in sugarbeet cultivar tolerance to a specific herbicide. The study was set up so that 37 cultivars were treated with 4 different applications of the herbicide (37*4 factorial). In doing so, we found that the interaction effect was
2016 Apr 11
0
[PATCH] nouveau: Switch perms from macros to octal notations, module params readable to everyone
From: poma <pomidorabelisima at gmail.com> Switch from "silly" S_* macros to "definitely more readable" octal "way" permissions, moreover to not "so restrictive" module parameters permissions. Suggested-by: Ilia Mirkin <imirkin at alum.mit.edu> Fixes: poma <pomidorabelisima at gmail.com> Tested-by: poma <pomidorabelisima at
2000 Sep 29
0
Is it R or I?
Salutations: I have been trying to translate a S-PLUS/ArcInfo (GIS software) application that I wrote on a SGI (IRIX) platform to public domain R and GrassGIS on a Linux platform. I am almost on the verge of abandoning it as I find R to be rather unstable, slow and frustrating. I enclose a section of my code for R experts to examine hoping that they'll point out that all the above three are
2003 May 19
0
[PATCH] getpwnam() implementation in tftpd.c
Hi, This patch implements a minimal getpwnam() function in tftpd.c. The reason for the patch is that I needed tftpd to work in my embedded system, which are without libnss*. The patch has been tested, and works for me. Please consider it. Best regards, jules -- Jules Colding <JuBColding at yorkref.com> York Refrigeration diff -urN tftp-hpa-0.34.orig/tftpd/Makefile