search for: yourvector

Displaying 8 results from an estimated 8 matches for "yourvector".

2003 Sep 22
1
(no subject)
Hi, I have a problem to understand the use of subsets of data while running a regression model. In particular, I am using sm.regression with these commands plot(lndip96,gdip,col=1,type= "n") sm.regression(add=T,lndip96,gdip) and I must run this model for two subsets of the data; in particular for lndip<=2.7 and for lndip>2.7. Thank you in advance for your help Roberto Basile
2009 Dec 10
2
What is the function to test if a vector is ordered or not?
I did a search on www.rseek.org to look for the function to test if a vector is ordered or not. But I don't find it. Could somebody let me know what function I should use?
2004 Oct 07
3
replace a value in a vector
OK, so this is a really stupid question and should be incredibly simple to do but I can't figure it out. So maybe someone would be so kind as to tell me. I have a vector of zeros and ones. I want to replace all of the zeros with "black" and all of the ones with "gray". That's it. Any help would be appreciated. Thanks, Paul `-:-. ,-;"`-:-. ,-;"`-:-.
2008 Jun 06
1
editing a data.frame
dear R users, the data frame (read in from a csv) looks like this: TreeTag Census Stage DBH 1 CW-W740 2001 juvenile 5.8 2 CW-W739 2001 juvenile 4.3 3 CW-W738 2001 juvenile 4.7 4 CW-W737 2001 juvenile 5.4 5 CW-W736 2001 juvenile 7.4 6 CW-W735 2001 juvenile 5.4 ... 1501 1.00E-20 2001 adult 32.5 i would like to
2009 Jul 07
6
how to count number of elements in a vector that are not NA ?
Hi, is there a simpler way to count the number of elements in a vector that are not NA than this: countN <- function (v) { return (Reduce(function (x, y) x + y, ifelse(is.na(v), 0, 1))) } ? - Godmar
2013 Jul 12
3
Needing help for excluding vector elements
Hello, R for Dummies. How can I exclude the first 1000 values of a vector (length 12000)? More generally all the values up to the ith? Thanks for your help, Dr Olivier Charansonney Cardiologue Centre Hospitalier Sud-Francilien, Corbeil-Essonnes, France [[alternative HTML version deleted]]
2008 Apr 09
4
Skipping specified rows in scan or read.table
Hi, I have a data file, certain lines of which are character fields. I would like to skip these rows, and read the data file as a numeric data frame. I know that I can skip lines at the beginning with read.table and scan, but is there a way to skip a specified sequence of lines (e.g., 1, 2, 10, 11, 19, 20, 28, 29, etc.) ? If I read the entire data file, and then delete the character
2008 Jun 06
6
Subsetting to unique values
I want to take the first row of each unique ID value from a data frame. For instance > ddTable <- data.frame(Id=c(1,1,2,2),name=c("Paul","Joe","Bob","Larry")) I want a dataset that is Id Name 1 Paul 2 Bob > unique(ddTable) Will give me all 4 rows, and > unique(ddTable$Id) Will give me c(1,2), but not accompanied by the name column.