similar to: csv vs. data frame

Displaying 20 results from an estimated 20000 matches similar to: "csv vs. data frame"

2011 May 12
3
assigning creating missing rows and values
I have a dataset where I have missing times (11:00 and 16:00). I would like the outputs to include the missing time so that the final time vector looks like "realt" and has the previous time's value. Ex. If meas at time 15:30 is 0.45, then the meas for time 16:00 will also be 0.45. meas are the measurements and times are the times at which they were taken. meas<-runif(18)
2011 May 15
2
Unexpected behaviour as.data.frame
I use the following code to create two data.frames d1 and d2 from a list: types <- c("integer", "character", "double") nlines <- 10 d1 <- as.data.frame(lapply(types, do.call, list(nlines)), stringsAsFactor=FALSE) l2 <- lapply(types, do.call, list(nlines)) d2 <- as.data.frame(l2, stringsAsFactors=FALSE) I would expect d1 and d2 to be the
2010 Dec 26
1
A question on Statistics
I am not a pure Statistics background and therefore please forgive me if this question (which is not R related either) is too trivial. In many Statistics literature I find following statement: "restrictions in different coefficients matrices have to be imposed to ensure uniqueness of the parametrization". Can somebody tell me what is the meaning of Uniqueness in the parametrization?
2011 Jan 22
2
effect size measure for dependent samples
Any advice on which package I can use for calculating effect sizes for two dependent samples? compute.es seems only to consider independent samples. Thanks in advance Steve Powell [[alternative HTML version deleted]]
2011 Mar 18
3
Arguments of a function
Hi, everybody, I just want to pass arguments to a function as below: range <- c(0.1, 0.5) runif(1, range) But it doesn?t work. Does anyone have any suggestions to offer? Thanks. Lisa -- View this message in context: http://r.789695.n4.nabble.com/Arguments-of-a-function-tp3387643p3387643.html Sent from the R help mailing list archive at Nabble.com.
2011 Mar 21
1
value changed after paste() function
Hi all, I am new user in R, I am trying to to use paste function to concatenate strings which has been fetched from database table(postgres database), the following are my code: when i do: > sqlFetch(channel,'transactions') outputs are following(only parts, there are around 200 transactions in total) orderid productname price quantity discount 1 T10248 potato 1.80
2011 Feb 09
2
comparing proportions
Hi, I have a dataset that has 2 groups of samples. For each sample, then response measured is the number of success (no.success) obatined with the number of trials (no.trials). So a porportion of success (prpop.success) can be computed as no.success/no.trials. Now the objective is to test if there is a statistical significant difference in the proportion of success between the 2 groups of
2011 Mar 08
1
ok to use glht() when interaction is NOT significant?
Hi, let's say I have a simple ANOVA model with 2 factors A (level A1 and A2) and B (level B1 and B2) and their interaction: aov(y~A*B, data=dat) It turns out that the interaction term is not significant (e.g. P value = 0.2), but if I used glht() to compare A1 vs. A2 within each level of B, I found that the comparison is not significant when B=B1, but is very significant (P<0.01) when
2011 Feb 09
1
Two Factors and a Numeric Variable in a Plot
Hi list. I'm trying to plot a graph "by" factors. Exactly, the x axis are my depths (as.factor), my left y axis are my transects (also as.factor) and I want to plot the mean and standard deviation (three samples per factor combination) of my SW (numeric) variable. The second y axis (at the right) will, probably, need to be displayed several times (for both left y axis
2010 Jul 02
2
Why doesn't my change of "Renviron.site" work on "windows 7" ?
Hi all, I added the following line on the "Renviron.site" file: R_LIBS=C:\Program Files (x86)\R\library And when I start R and run: .libPaths() I don't see this path. On windows XP it worked for me. I am now using windoes 7 (64 bit) with R 32. Is there a reason this shouldn't work? Thanks, Tal ----------------Contact
2011 Jan 31
2
identify subsets based on two grouping factors
Hi, I have a data.frame that has a categorical variable, for which I would like to look at the distribution of levels of this variable, based on a grouping of two other variables. As an example: x <- data.frame(obs=sample(c('low', 'high'),100, replace=TRUE), grp1=sample(1:10, 100, replace=TRUE), grp2=runif(100)) cut.grp1 <- cut(x$grp1, 3) cut.grp2 <- cut(x$grp2, 3)
2010 Oct 01
1
'all subsets' fitting algorithm for Bayesian approach
Hi R experts I am just wondering if something is already available (or easily adaptable) to do the following. I am planning to build linear models for all possible combinations of terms, so for example if the terms are sent into a function as this string " X1 + X2 + X3 + X4 + X1:X2" I would want to build models for all possible combinations of these 5 terms, e.g. m1 <- lm( y ~
2011 May 18
3
R Style Guide -- Was Post-hoc tests in MASS using glm.nb
Thanks Bill. Do you and others think that a link to this guide (or another)should be included in the Posting Guide and/or R FAQ? -- Bert On Tue, May 17, 2011 at 4:07 PM, <Bill.Venables at csiro.au> wrote: > Amen to all of that, Bert. ?Nicely put. ?The google style guide (not perfect, but a thoughtful contribution on these kinds of issues, has avoiding attach() as its very first line.
2010 Jun 24
4
Simple qqplot question
I am a beginner in R, so please don't step on me if this is too simple. I have two data sets datax and datay for which I created a qqplot qqplot(datax,datay) but now I want a line that indicates the perfect match so that I can see how much the plot diverts from the ideal. This ideal however is not normal, so I think qqnorm and qqline cannot be applied. Perhaps you can help? Ralf
2011 May 26
4
Applying "toupper" to only portions of text strings
Colleagues Assume that I have a vector containing some text strings, some of which contain a particular character. I could like to apply "toupper" to the text before the character. For example (in this case, "|" is the particular character): ORIGINAL: TEXT <- c("aaaa", "bbb|cc", "|ddd") AFTER APPLICATION OF toupper: TEXT <-
2011 Mar 16
5
R² for non-linear model
Dear List, how can I obtain the value of r suqared for a non-linear model? For linear models it can be found in the summary() of the model but for non-linear models I just don't know. Please help! Anna
2011 Jan 12
5
2d plot with modification of plotting symbol to indicate third dimension.
I would like to plot 3-dimensional data on a two-dimensional scatter-plot. Is there a way I can automatically modify the plot symbol (e.g. changing size or color) to indicate the value of a third variable? E.g. How can I plot weight vs. age and indicate the value of muscle mass for each value weight-age pair by making the plot point proportional to the subject's muscle mass? Thanks, John
2010 Dec 21
4
Keeping Leading Zeros, Treating numbers as text
Hello, I have a data set, with some numerical values, some non-numerical data, my issue is that I need to preserve my ID numbers (numerics) with the leading zeros, but when I import the data into R (it's in .csv format) using the read.csv(" ") command, it turns all the ID numbers (Example: 00210) into numbers, removing the leading zeros, so I end up with 210. I tried using the
2010 Aug 19
1
Why does Bootstrap work for one of similar models but not for the other?
Dear all, Could anyone help me figure out why bootstrap works for one of similar models but not for the other and how I can solve it? I am using R 2.11.1 in Windows and would like to get confidence intervals for my models A and B by bootstrapping. However, bootstrap gives expected output for the model A but not for B, which I found was puzzling because the structure of the models is
2011 May 21
4
Looping through values in a data frame that are >zero
Hello! I've tried for a while - but can't figure it out. I have data frame x: y=c("a","b","c","d","e") z=c("m","n","o","p","r") a=c(0,0,1,0,0) b=c(2,0,0,0,0) c=c(0,0,0,4,0) x<-data.frame(y,z,a,b,c,stringsAsFactors=F) str(x) Some of the values in columns a,b, and c are >0: I need to