Displaying 20 results from an estimated 30000 matches similar to: "excluding NAs in data frame without deleting rows"
2009 May 27
2
Object-oriented programming in R
Dear R-users,
I have very recently started learning about object-oriented programming
in R. I am far from being an expert in programming, although I do have
an elementary C++ background.
Please take a look at these lines of code.
> some.data = data.frame(V1 = 1:5, V2 = 6:10) ;
> p.plot = ggplot(data=some.data,aes(x=V1, y=V2)) ;
> class(p.plot) ;
> [1] "ggplot"
My
2009 May 26
4
Creating multiple graphs based on one variable
Dear List,
I would like to create several graphs of similar data. I have x and y values for several different individuals (in this case fish). I would like to plot the x and y values for each fish separately. I can do it using a for loop, but I think I should be using "apply". Please let me know what I am doing wrong, or if there is a "better" way to do this. What I have
2009 May 20
2
How to load data from Statistics Canada
We would like to load data from Statistics Canada
(http://www.statcan.gc.ca/) using R,
for example, Employment and unemployment rates.
It seems to me that the tables are displayed in HTML.
I was wondering if you know how to load these tables. Thanks,
-james
2009 May 08
2
Help to extract results from lme.object
Hi list,
Would someone please give me a hint how to extract the between and within
subject StdDev from "lme" fit? Below is the output from the fit, but I couldn't
find the number 0.3927714 anywhere in the fitted object. Thanks in advance for
your help!
Random effects:
Formula: ~1 | group
(Intercept) Residual
StdDev: 0.3927714 0.7857085
Best,
Auston
2009 May 14
1
automated polynomial regression
Dear all -
We perform some measurements with a machine that needs to be
recalibrated. The best calibration we get with polynomial regression.
The data might look like follows:
> true_y <- c(1:50)*.8
> # the real values
> m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.2
> # the measured data
> x <- c(1:50)
> # and the x-axes
>
> # Now I do the following:
2009 May 29
2
remove object
Hi list....
I try to remove all object less one, this object is called index. I have
many object with different names and pattern option in ls function may not
remove this object why any word in index object repeats with other object.
Anybody can give me one advise for this question....
Thank for all
fernando
[[alternative HTML version deleted]]
2009 May 11
3
Searching within a ch. string
Hi all, is there any function to find some words in a character-string? For
example suppose the string is : "gdfsa-sdhchc-88", now I want to find
whether this string contains "sdhch". Is there any R function to do that?
Regards,
--
View this message in context: http://www.nabble.com/Searching-within-a-ch.-string-tp23484010p23484010.html
Sent from the R help mailing list
2009 May 28
4
How this addition works?
I have following addition :
> 1:2 + 1:10
[1] 2 4 4 6 6 8 8 10 10 12
I could not understand how R adding those two unequal vector? Any help?
[[alternative HTML version deleted]]
2009 May 13
2
[OT?]R Reference Manual review/recommend
Hello all
I am looking to learn R and was thumbing through volume 1 of "R
reference manual - Base Package". I'm sorry if this is ludicrously
silly to ask, but is this book worth the investment as a good way to
learn how to use R?
AG
2009 May 13
2
Input to variables - help please
Dear list
I have managed to write a short program to evaluate data which is inputted
from a csv file using the following
x = read.csv("wms_results.csv", header=TRUE)
All works fine but since I have a number of similar data files which have
different names, I would like the program to allow me to input the file
name, rather than having to edit the program.
>From the documentation I
2009 May 19
2
Getting lm() to work with a matrix
Hi
I'm fairly new to R and am trying to analyse some large spectral datasets
using stepwise regression (fairly standard in this area). I have a field
sampled dataset, of which a proportion has been held back for validation. I
gather than step() needs to be fed a regression model and lm() can produce a
multiple regression. I had thought something like:
spectra.lm <-
2009 May 19
2
Using while statements to insert rows in a dataframe
Hi.
I am very new to R and have been diligently working my way through the manual and various tutorials. I am now trying to work with some of my own data and have encountered a problem that I need to fix. I have a dataframe with 8 columns and approximately 850 rows. I have provided an excerpt of the dataframe below. Within column 6 (Question) the numbers 1:33 repeat down the entire column.
2009 May 06
2
Print to File Formatting
Hello,
I am writing out to a file and have two quick questions that I can't
seem to track down the correct answers for. Luckily, I *think* they
are both simple enough that someone might be able to point me in the
right direction on them without too much trouble.
Both questions relate to the process below where CompleteFrame is a
data frame containing what I want printed to a file.
filename
2009 May 29
5
maxtrix to permutation vector
Hi,
Is there a way to convert a matrix into a vector representing all
permutations of values and column/row headings with native R functions?
I did this with 2 nested for loops and it took about 25 minutes to run
on a ~700x700 matrix. I'm assuming there must be a smarter way to do
this with R's vector commands, but being new to R, I'm having trouble
making it work.
Thanks,
2009 May 20
10
How to google for R stuff?
Hi! I'm new to R programming, though I've been programming in other
languages for years.
One thing I find most frustrating about R is how difficult it is to use
Google (or any other search tool) to look for answers to my R-related
questions. With languages with even slightly more distinctive names like
Perl, Java, Python, Matlab, OCaml, etc., usually including the name of the
language
2010 Mar 08
1
[help] deleting rows which contain more than 2 NAs or zeros
Hello.
I have just started learning how to work with R program but I have
encountered a problem.
I can't think up how to remove the rows which contain two (2) or more NA or
Zero (0).
I would be glad if you could help me because I just have some basic
knowledge so far and I even haven't mastered all the basics yet as well.
Thanks in advance.
--
View this message in context:
2010 Dec 08
4
evaluating NAs in a dataframe
Hi all,
How can one evaluate NAs in a numeric dataframe column? For example, I have
a dataframe (demo) with a column of numbers and several NAs. If I write
demo.df >= 10, numerals will return TRUE or FALSE, but if the value is
"NA", "NA" is returned. But if I write demo.df == "NA", it returns as "NA"
also. I know that I can remove NAs, but would like
2008 Dec 11
1
Extract rows from data frame based on row names from another data frame
Hi all,
Is there a function to extract row names from a data frame based on
row names from another data frame? I can write a loop function to do
this, but this may be inefficient in terms of processing.
thanks for any information,
Wade
2011 Aug 13
3
Excluding NAs from round correlation
Hello,
I am quite new to R and I am trying to get a round correlation from a table
with dozens of columns. However, all the columns contain several blank
places which show to me as NAs. Then, when I type round(cor(data),2), I get
no results - everything (except correlation of one column with the same one,
of course) is NA.
I do not want to replace NA with zero, because it would ruin the results. I
2009 Dec 17
2
Sweave Makefile issue
Dear R-specialists,
I am trying to create a Makefile that will first convert all my .Rnw
files into .tex files and then, that will run the LaTeX compiler to
produce a pdf document. This issue has been discussed before. Hence,
I've basically adapted a Makefile I found at
http://n4.nabble.com/R-Sweave-R-and-complex-latex-projects-td810020.html#a810023
to make it compatible with a Windows