Displaying 20 results from an estimated 66 matches for "column2".
Did you mean:
column
2004 Aug 17
2
levels of factor
R-help,
I have a data frame wich I subset like :
a <- subset(df,df$"column2" %in% c("factor1","factor2") & df$"column2"==1)
But when I type levels(a$"column2") I still get the same levels as in df (my original data frame)
Why is that?
Is it right?
Luis
Luis Ridao Cruz
Fiskiranns??knarstovan
N??at??n 1
P.O. Box 3051
FR-1...
2010 Oct 04
1
Splitting a DF into rows according to a column
...eros. Curabitur fringilla dui ac dui
rutrum pretium. Donec sed magna adipiscing nisi accumsan congue sed ac est.
Vivamus lorem urna, tristique quis accumsan quis, ullamcorper aliquet
velit."
> tmpDF <- data.frame(Column1=rep(unlist(strsplit(loremIpsum,"
")),length.out=510),Column2=runif(510,min=0,max=1e8))
is to be split into DFs with 50 entries in an ordered manner according to
column2 (first DF ist o contain the rows with the 50 largest numbers, ...).
Here is what I have been doing:
> binSize <- 50
> splitMembership <-
pmin(ceiling(order(tmpDF[["Colum...
2024 Jun 06
2
R Shiny Help - Trouble passing user input columns to emmeans after ANOVA analysis
...nse variable
output$column_selector_1 <- renderUI({
req(data())
selectInput("column1","Select response variable", choices =
names(data()))
})
# Select first independent variable
output$column_selector_2 <- renderUI({
req(data())
selectInput("column2", "Select first independent variable", choices =
names(data()))
})
# Select second independent variable
output$column_selector_3 <- renderUI({
req(data())
selectInput("column3", "Select second independent variable", choices =
names(data()))
})...
2010 May 31
2
accessing a data frame with row names
Readers,
I have entered a file into r:
,column1,column2
row1,0.1,0.2
row2,0.3,0.4
using the command:
dataframe<-read.table("/path/to/file.csv",header=T,row.names=1)
When I try the command:
dataframe[,2]
I receive the response:
NULL
I was expecting:
row1 0.2
row2 0.4
What is my error with the syntax please?
Yours,
r251
mandriva200...
2004 Nov 23
5
number of pairwise present data in matrix with missings
is there a smart way of determining the number of pairwise present data
in a data matrix with missings (maybe as a by-product of some
statistical function?)
so far, i used several loops like:
for (column1 in 1:99) {
for (column2 in 2:100) {
for (row in 1:500) {
if (!is.na(matrix[row,column1]) & !is.na(matrix[row,column2])) {
pairs[col1,col2] <- pairs[col1,col2]+1
}
}
}
}
but this seems neither the most elegant nor an utterly fast solution.
thanks for suggestions.
andreas wolf
2008 Feb 26
1
Split data.frames depeding values of a column
Hello to all
is there a function wich splits a data.frame (column1,column2,column3,....)
into
data1 <-(column1,column3....) #column2 = 1
data2 <-(column1,column3....) #column2 = 2
data3 <-(column1,column3....) #column2 = 3
...
Regards Knut
2009 May 14
2
Function to read a string as the variables as opposed to taking the string name as the variable
I am writing a custom function that uses an R-function from the
reshape package: cast. However, my question could be applicable to
any R function.
Normally one writes the arguments directly into a function, e.g.:
result=cast(table1, column1 + column2 + column3 ~ column4,
mean) (1)
I need to be able to write this statement as follows:
result=cast(table1, string_with_columns ~ column4, mean) (2)
string_with_columns = group of functions that ultimately outputs:
"column1 + column2 + column3"
Statement 1 outputs th...
2009 Jun 13
3
How Can I insert another column data into the CSV file when I use FasterCSV?
Hi, All,
Suppose I have a CSV file, there is data in it.
* Column 1 Column2 Column 3 Column 4
Row1 a b c
Row2 a2 b2 c2*
You know, the column 4 is no data
Now, I would like to insert data to Column 4, after save, the CSV file will
be:
* Colu...
2024 Dec 11
1
Cores hang when calling mcapply
...data efficiently as data.table
> dt <- as.data.table(
> open_dataset(
> sources = input_files,
> format = 'csv',
> unify_schema = TRUE,
> col_types = schema(
> "ID_Key" = string(),
> "column1" = string(),
> "column2" = string()
> )
> ) |>
> collect()
> )
>
> # Step B: Clean names once
> # Assume `crewjanitormakeclean` essentially standardizes column names
> dt[, column1 := janitor::make_clean_names(column1, allow_dupes =
> TRUE)]
> dt[, column2 := janitor::make...
2024 Dec 12
1
Cores hang when calling mcapply
...server configuration:
temp <-
??????open_dataset(
????????????sources = input_files,
????????????format = 'csv',
????????????unify_schema = TRUE,
????????????col_types = schema(
????????????"ID_Key" = string(),
????????????"column1" = string(),
????????????"column2" = string()
????????????)
??????) |> as_tibble()
??????
??keeptabs <- split(temp, temp$ID_Key)
if(isTRUE(multicore)){
keeptabs <- mclapply(1:length(keeptabs), function(i) crewjanitormakeclean(keeptabs[[i]],c("column1","column2")), mc.cores = numcores)...
2024 Dec 12
1
Cores hang when calling mcapply
...nt.
To avoid this, consider converting?`keeptabs` into a `data.table` directly before calling `dcast()`. For example:
>?setDT(keeptabs)
> out1 <- dcast(keeptabs, ID_Key ~ column1, fun.aggregate = length, value.var = "column1")
> out2 <- dcast(keeptabs, ID_Key ~ column2, fun.aggregate = length, value.var = "column2")
If?`keeptabs` is a `data.table` at the time of calling `dcast()`, this ensures the `data.table` method of `dcast()` is used and should eliminate the warning message maintaining compatibility with? future updates of the `data.table` pa...
2006 Jan 04
3
matrix math
...rame has 20 variables (“cocolumns") and 525 observations (“rows”). All variables are numeric.
I want to create a new dataframe that also has 20 columns and 525 rows. The values in this dataframe should be the sum of the 2 other dataframe.
(i.e. temp1$column 1+temp2$column1, temp1$column2+temp2$column2, etc)
What is the best/easiest way to accomplish this?
Is I wish to "multiply" (instead of sum) the columns, how do I?
I tried:
temp3<-as.matrix(temp1)+as.matrix(temp2)
I get the following error message: “Error in as.matrix(temp1) + as.matrix...
2024 Dec 11
1
Cores hang when calling mcapply
...data efficiently as data.table
> dt <- as.data.table(
> open_dataset(
> sources = input_files,
> format = 'csv',
> unify_schema = TRUE,
> col_types = schema(
> "ID_Key" = string(),
> "column1" = string(),
> "column2" = string()
> )
> ) |>
> collect()
> )
>
> # Step B: Clean names once
> # Assume `crewjanitormakeclean` essentially standardizes column names
> dt[, column1 := janitor::make_clean_names(column1, allow_dupes =
> TRUE)]
> dt[, column2 := janitor::make_cl...
2009 Jun 17
6
script help
Hi
?
I have a file. list.txt (two columns)
?
column1??? column2
name??????? address
?
?
I need to put in the letter file letter.txt eg:
?
Dear: Chloe
Address: CA
?
Can I use this
?
for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt
?
Thank you for your help
?
?
?
?
?
_____________________________________________________________...
2010 Feb 27
1
New Variable from Several Existing Variables
...;Yes", however if any one of the three existing variables is
a "No", then then new variable should be a "No". I would then use that new
variable as an exclusion for data in a new or existing dataset (i.e., if
NewVariable = "No" then delete):
Take this:
Column1, Column2, Column3
Yes, Yes, Yes
Yes, No, Yes
No, No, No
No, Yes, No
Yes, Yes, No
Generate this:
Column1, Column2, Column3, NewVariable1
Yes, Yes, Yes, Yes
Yes, No, Yes, No
No, No, No, No
No, Yes, No, No
Yes, Yes, No, No
And end up with this:
Column1, Column2, Column3, NewVariable1
Yes, Yes, Yes, Yes
Any...
2009 Jun 15
2
Help with syntax error
Hi,
I have written boxplot commands of this form before, but I don''t quite understand why the function call is reporting a syntax error in this instance. All parameters passed to the function are strings.
Thanks in advance.
Payam
> simplevar <- function(wframe,column1,column2) {
+ tframe <- get(wframe)
+ x1 <- which(names(wframe)==column1)
+ x2 <- which(names(wframe)==column2)
+ print(tframe[x1])
+ print(tframe[x2])
+ gtitle <- paste(names(tframe[x2])," vs. ", names(tframe[x1])
+ quartz(width=7,height=5,dpi=200)
Error: s...
2024 Dec 11
1
Cores hang when calling mcapply
...n_dataset(
> > >??? sources = input_files,
> > >??? format = 'csv',
> > >??? unify_schema = TRUE,
> > >??? col_types = schema(
> > >????? "ID_Key" = string(),
> > >????? "column1" = string(),
> > >????? "column2" = string()
> > >??? )
> > >? ) |>
> >
> > >??? collect()
> > > )
> > >
> > > # Step B: Clean names once
> > > # Assume `crewjanitormakeclean` essentially standardizes column names
> > > dt[, column1 := janitor:...
2013 Mar 21
2
Displaying median value over the horizontal(median)line in the boxplot
...52 but I only want it to be displayed as 7.6.
Thank you so much for your help. I am very sorry for troubling you but I am very very new to this programming and to R as you can see.
<quote author='arun kirshna'>
Hi,
Lines1<-readLines(textConnection("Column1 -1,2,3,4,5,6,6,7
COlumn2- 3,4,5,6,7,8,8
Column3-- 45,66,7,8,89,
COlumn4-5,6,7,7,8,9
Column5 -5,6,7,8,8"))
vec1<-unlist(strsplit(Lines1,"-"))
dat1<-as.data.frame(t(read.table(text=vec1[grepl(",",vec1)],sep=",",fill=TRUE)))
row.names(dat1)<-NULL
colnames(dat1)<-tolower(gsub(&q...
2004 Oct 25
2
Reading sections of data files based on pattern matching
...I want
to analyze plot etc.
Since this will be used many people at the department I wanted to make
sure that will do this in the best way.
For instance I want to read a snippets of data from a text that look
like this.
-------------------------------
Lots of stuff
...
@@Start Values@@
Column1 Column2 Column3 ...
Row1 1 2 3 ...
...
@@End Values@@
More stuff
...
@@Start OtherValues@@
Column1 Column2 Column3 ...
Row1 1 2 3 ...
...
@@End OtherValues@@
I looked in the help files and found grep which operates on character
strings, do I have to like this then?
1. Read file with readLines("f...
2024 Dec 11
1
Cores hang when calling mcapply
...lt;- as.data.table(
> >?? open_dataset(
> >??? sources = input_files,
> >??? format = 'csv',
> >??? unify_schema = TRUE,
> >??? col_types = schema(
> >????? "ID_Key" = string(),
> >????? "column1" = string(),
> >????? "column2" = string()
> >??? )
> >? ) |>
>
> >??? collect()
> > )
> >
> > # Step B: Clean names once
> > # Assume `crewjanitormakeclean` essentially standardizes column names
> > dt[, column1 := janitor::make_clean_names(column1, allow_dupes =?
>...